RE: [PHP] Re: is_null misses spaces... another solution?
| From: | Johnson, Kirk | Date: | Tue, 13 Nov 2001 18:03:51 +0000 |
| Subject: | RE: [PHP] Re: is_null misses spaces... another solution? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-74475@lists.php.net to get a copy of this message | ||
A space is a valid string. Are you sure there is a space?
<?
$a = ' ';
if($a == '') {
echo "a is blank<br>";
} else {
echo "a is not blank<br>"; // this is printed
}
if(is_null($a)) {
echo "a is null<br>";
} else {
echo "a is not null<br>"; // this is printed
}
?>
Kirk
> > I need to check variables for blank values but it appears
> that is_null and
> > =="" return true if there is a space.
> >
> > Any other suggestions?