In PHP, the following values are considered falsy:
- Empty String;
- Array with no elements,
SimpleXMLobjects that are created from empty elements (i.e. elements that have no children and attributes).
These values evaluate to a boolean
- They're explicitly converted to a boolean (for example by casting);
- An operator, function or control structure requires a boolean argument (in which case the value is converted to a boolean implicitly/automatically).
Hope you found this post useful. It was published . Please show your love and support by sharing this post.