php boolean type judgment

 

  String is true as long as it is not empty and not 0

  The execution result is

       The execution result is false

       Because === compares not only values, but also types, the output is false. If you use the === sign to compare, it is best to cast the variable to bool type first, otherwise you may not get the desired result

    The number 0 is false

  empty array is false

  null is false

  A variable with a negative value is false

      

 

 

 

  

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325939193&siteId=291194637
Recommended