Students Empire

Learn Something New
Home

Learn PHP


PHP identical operator


The === operator is useful when comparing against false with 0 and empty string


For example, PHP considers an empty string (""), 0, and false to be equal when used with ==, but using === allows you to make the distinction.


                <?PHP
                 if (0 === true) {                                                                               
                    print(" this is true ");
                 }                                                                                                
                 if (0 === false) { 
                    print("this is false ");
                 } 
            ?>