ap_in_array_r( mixed $needle, mixed $haystack, boolean $strict = false )
Description #
Find item in in child array.
Parameters #
- $needlemixed (Required) Needle to find.
- $haystackmixed (Required) Haystack.
- $strictboolean (Optional) Strict match. Default value: false
Source #
File: includes/functions.php
function ap_in_array_r( $needle, $haystack, $strict = false ) { foreach ( $haystack as $item ) { if ( ( $strict ? $item === $needle : $item == $needle ) || ( is_array( $item ) && ap_in_array_r( $needle, $item, $strict ) ) ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual return true; } } return false; }
Expand full source code Collapse full source code View on GitHub: includes/functions.php:1916
Add your comment