note 53657 added to function.empty
| From: | admin at prelogic dot net | Date: | Wed, 08 Jun 2005 14:37:27 +0000 |
| Subject: | note 53657 added to function.empty | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-90118@lists.php.net to get a copy of this message | ||
In response to admin at ninthcircuit dot info
The best way around that is the trim function. For example:
$spaces = " ";
if(empty(trim($spaces)){
echo "Omg empty string.";
}else{
echo "Omg the string isnt empty!";
}
Hope that helps anyone, though it is rather trivial.
----
Manual Page -- http://www.php.net/manual/en/function.empty.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53657
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53657&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53657&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53657&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53657&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53657&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53657&report=yes
Search -- http://master.php.net/manage/user-notes.php