/ Published in: PHP
![](/img/icon_sav.png?v3)
Search recursive in array
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Recursive in_array functie function in_array_r($needle, $haystack, $strict = true) { foreach ($haystack as $item) { if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && in_array_r($needle, $item, $strict))) { return true; } } return false; }
Comments
![RSS Feed for Comments RSS Icon](/images/rss.png?v3)