aej1973
asked on
Ckecking for empty strings in PHP
How do I check if a string variable is empty using PHP? My variable is $name. Presently, I have a statement that looks like this:
if ($name == "") {...} else {...}
but if I enter one or more blank spaces into $name, control passes to the else part. I want to block this and make sure the else part is carried out only if $name is not empty.
Thank you.
A
if ($name == "") {...} else {...}
but if I enter one or more blank spaces into $name, control passes to the else part. I want to block this and make sure the else part is carried out only if $name is not empty.
Thank you.
A
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.