note 36084 added to function.array-search
| From: | mediat at rn2 dot php dot net | Date: | Thu, 25 Sep 2003 11:34:00 +0000 |
| Subject: | note 36084 added to function.array-search | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-57088@lists.php.net to get a copy of this message | ||
the simplest way to check for returned value (if it's null or 0) is to compare the result with
the searched value, ex:
$place = array_search($id_log, $log_array);
if($log_array[$place] == $id_log)
unset($log_array[$place]);
this will delete the searched value even if it's 0
----
Manual Page -- http://www.php.net/manual/en/function.array-search.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+36084
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+36084&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+36084&report=yes