note 119294 added to function.array-search
| From: | Anonymous | Date: | Sat, 07 May 2016 00:05:42 +0000 |
| Subject: | note 119294 added to function.array-search | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-205435@lists.php.net to get a copy of this message | ||
for xfoxawy soulution if the value you're searching for is a boolean or 0 then you should check
it like this...
<?php
$key = array_search(0, array_column($userdb, 'uid'));
if($key != null){
echo "found something.";
}else{
echo "found nothing.";
}
?>
----
Server IP: 72.52.91.14
Probable Submitter: 24.233.186.27
----
Manual Page -- http://php.net/manual/en/function.array-search.php
Edit -- https://master.php.net/note/edit/119294
Del: integrated -- https://master.php.net/note/delete/119294/integrated
Del: useless -- https://master.php.net/note/delete/119294/useless
Del: bad code -- https://master.php.net/note/delete/119294/bad+code
Del: spam -- https://master.php.net/note/delete/119294/spam
Del: non-english -- https://master.php.net/note/delete/119294/non-english
Del: in docs -- https://master.php.net/note/delete/119294/in+docs
Del: other reasons-- https://master.php.net/note/delete/119294
Reject -- https://master.php.net/note/reject/119294
Search -- https://master.php.net/manage/user-notes.php