note 27686 added to function.empty
| From: | ckluge at friko3 dot onet dot pl | Date: | Sun, 15 Dec 2002 19:29:31 +0000 |
| Subject: | note 27686 added to function.empty | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-40939@lists.php.net to get a copy of this message | ||
There is at least one case where the empty() function is very useful - it is when you have
operations on an array. Imagine that you are storing data in an array, adding and unsetting elements
- the quick method of checking if anything is left in an array is simply checking if empty($array)
is FALSE (note that key_exists() works only if you check for the specific key)
--
http://www.php.net/manual/en/function.empty.php
http://master.php.net/manage/user-notes.php?action=edit+27686
http://master.php.net/manage/user-notes.php?action=delete+27686
http://master.php.net/manage/user-notes.php?action=reject+27686