note 125043 added to function.in-array
| From: | fermar21 at gmail dot com | Date: | Mon, 25 May 2020 02:51:56 +0000 |
| Subject: | note 125043 added to function.in-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-214674@lists.php.net to get a copy of this message | ||
If you need to find if a value in an array is in another array you can use the function:
<?php
function array_in_array($arr_needle,$arr_haystack){
$retorno = false;
foreach ($arr_needle as $value) {
if(in_array($value, $arr_haystack)){
$retorno = true;
}
}
return $retorno;
}
?>
----
Server IP: 45.112.84.4
Probable Submitter: 177.234.144.170 (proxied: 181.16.122.167)
----
Manual Page -- http://php.net/manual/en/function.in-array.php
Edit -- https://master.php.net/note/edit/125043
Del: integrated -- https://master.php.net/note/delete/125043/integrated
Del: useless -- https://master.php.net/note/delete/125043/useless
Del: bad code -- https://master.php.net/note/delete/125043/bad+code
Del: spam -- https://master.php.net/note/delete/125043/spam
Del: non-english -- https://master.php.net/note/delete/125043/non-english
Del: in docs -- https://master.php.net/note/delete/125043/in+docs
Del: other reasons-- https://master.php.net/note/delete/125043
Reject -- https://master.php.net/note/reject/125043
Search -- https://master.php.net/manage/user-notes.php