note 129655 added to function.in-array
| From: | vittorh66@gmail.com | Date: | Mon, 15 Jul 2024 20:07:51 +0000 |
| Subject: | note 129655 added to function.in-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221427@lists.php.net to get a copy of this message | ||
this function in_array is not funcionali in arguments type array, See an example:
$arr = array('jaca','limao');
$arr2 = [ 'jaca' => "madura", 'limao' => 'verde' ];
if ( in_array($arr, array_flip($arr2))){
echo ' exists';
}else{
echo ' not exists';
}
// output: not exists
Test in version 7.4, 8.0, 8.1
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.84.18 (proxied: 191.32.84.135)
----
Manual Page -- https://php.net/manual/en/function.in-array.php
Edit -- https://main.php.net/note/edit/129655
Del: integrated -- https://main.php.net/note/delete/129655/integrated
Del: useless -- https://main.php.net/note/delete/129655/useless
Del: bad code -- https://main.php.net/note/delete/129655/bad+code
Del: spam -- https://main.php.net/note/delete/129655/spam
Del: non-english -- https://main.php.net/note/delete/129655/non-english
Del: in docs -- https://main.php.net/note/delete/129655/in+docs
Del: other reasons-- https://main.php.net/note/delete/129655
Reject -- https://main.php.net/note/reject/129655
Search -- https://main.php.net/manage/user-notes.php