public static function search(array $haystack, $needle)
    {
        foreach ($haystack as $key => $value) {
            if (is_array($value)) {
                $target = self::search($value, $needle); 
            } else {
                $target = '';
            }

            if ($needle === $value || ($target != false && $target != null)) {
                if ($target == null) {
                    return array($key);
                }
                return array_merge(array($key), $target);
            }
        }

        return false;
    }
public static function search(array $haystack, $needle)
    {
        foreach ($haystack as $key => $value) {
            if (is_array($value)) {
                $target = self::search($value, $needle); 
            } else {
                $target = '';
            }

            if ($needle === $value || ($target != false && $target != null)) {
                if ($target == null) {
                    return array($key);
                }
                return array_merge(array($key), $target);
            }
        }

        return false;
    }
public static function search ( array $ haystack , $ needle ) { foreach ( $ haystack as $ key => $ value ) { if ( is_array ( $ value ) ) { $ target = self :: search ( $ value , $ needle ) ; } else { $ target = '' ; } if ( $ needle === $ value || ( $ target != false && $ target != null ) ) { if ( $ target == null ) { return array ( $ key ) ; } return array_merge ( array ( $ key ) , $ target ) ; } } return false ; }
Search data by given value inside array recursively

@param array $haystack
@param string $needle
@return array|boolean
Search data by given value inside array recursively