Friday 31 July 2015

How to compare PHP Variables and Arrays with null or empty values


Sometimes it is a bit confusing for developer to select right compare statement to check variables or arrays as there are lots of compare functions like "isset()", "!" operator, "is_null()", "empty()" etc. So we can use a straight forward approach to do this:

1: For boolean value, use:

if ($var) {}
or
if (!$var) {}
 
2: Null or false value:

How to compare PHP Variables and Arrays with null or empty values
Read the full Blog How to compare PHP Variables and Arrays with null or empty values at FindNerd's Forum.

FindNerd is an effective C, Java, Android, Html, iOS, JavaScript, PHP Developer forum, to instantly resolve your various language queries.

Apart from this, If you have any html language issue, you can post at HTML questions and answeres and get instantly resolved it from highly experienced FindNerd community members.  

No comments:

Post a Comment