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.

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

One thought on “How to compare PHP Variables and Arrays with null or empty values

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s