note 52923 added to function.trim
| From: | dmr37atcornelldotedu at osu1 dot php dot net | Date: | Tue, 17 May 2005 19:47:46 +0000 |
| Subject: | note 52923 added to function.trim | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89560@lists.php.net to get a copy of this message | ||
Note that manithu's post on 29-Mar-2005 02:49 for identifying strings that only contain
whitespaces will also identify strings like "0" and " 0 " as being empty. If
you want to check whether something ONLY has whitespaces, use the following:
<?php
if (trim($foobar)=='') {
echo 'The string $foobar only contains whitespace!';
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.trim.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52923
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52923&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52923&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52923&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52923&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52923&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52923&report=yes
Search -- http://master.php.net/manage/user-notes.php