Thursday, July 3, 2008

How to check if a php variable is empty or not using PHP

You wanna check if a given string or php variable is empty?
You can easily do it using the php empty() function


$my_var = ''; //empty() also return true for 0

if (empty($my_var))
echo 'Its empty';
echo 'not empty';

Get custom programming done at!

No comments:

Post a Comment