note 121959 added to function.array-search
| From: | z dot chaitanya at gmail dot com | Date: | Fri, 01 Dec 2017 14:06:59 +0000 |
| Subject: | note 121959 added to function.array-search | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-209288@lists.php.net to get a copy of this message | ||
array_search in if condition
if(gettype(array_search($var, $array)) != 'boolean')
{
//$var exists in $array
}
else
{
//$var does not exist in $array
}
----
Server IP: 203.211.135.122
Probable Submitter: 182.71.234.2
----
Manual Page -- http://php.net/manual/en/function.array-search.php
Edit -- https://master.php.net/note/edit/121959
Del: integrated -- https://master.php.net/note/delete/121959/integrated
Del: useless -- https://master.php.net/note/delete/121959/useless
Del: bad code -- https://master.php.net/note/delete/121959/bad+code
Del: spam -- https://master.php.net/note/delete/121959/spam
Del: non-english -- https://master.php.net/note/delete/121959/non-english
Del: in docs -- https://master.php.net/note/delete/121959/in+docs
Del: other reasons-- https://master.php.net/note/delete/121959
Reject -- https://master.php.net/note/reject/121959
Search -- https://master.php.net/manage/user-notes.php