note 53701 added to function.empty
| From: | tan_niao at osu1 dot php dot net | Date: | Thu, 09 Jun 2005 15:43:33 +0000 |
| Subject: | note 53701 added to function.empty | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-90180@lists.php.net to get a copy of this message | ||
admin at prelogic dot net has wrote the following
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.
i think is said above that empty(trim($spaces)) dont work
,i think is better to seperate this two function
trim($spaces);
empty($spaces) thern continue with the code......
----
Manual Page -- http://www.php.net/manual/en/function.empty.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53701
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53701&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53701&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53701&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53701&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53701&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53701&report=yes
Search -- http://master.php.net/manage/user-notes.php