public static function match($array, array $queries, $strict = false)
    {
        $results = [];

        // Visit Query Rules
        foreach ($queries as $key => $val) {
            if (substr($key, -2) === '>=') {
                $results[] = (static::getByPath($array, trim(substr($key, 0, -2))) >= $val);
            } elseif (substr($key, -2) === '<=') {
                $results[] = (static::getByPath($array, trim(substr($key, 0, -2))) <= $val);
            } elseif (substr($key, -1) === '>') {
                $results[] = (static::getByPath($array, trim(substr($key, 0, -1))) > $val);
            } elseif (substr($key, -1) === '<') {
                $results[] = (static::getByPath($array, trim(substr($key, 0, -1))) < $val);
            } elseif (is_array($val)) {
                $results[] = in_array(static::getByPath($array, $key), $val, $strict);
            } else {
                if ($strict) {
                    $results[] = (static::getByPath($array, $key) === $val);
                } else {
                    // Workaround for PHP object compare bug, see: https://bugs.php.net/bug.php?id=62976
                    $compare1 = is_object(static::getByPath($array, $key)) ? get_object_vars(
                        static::getByPath(
                            $array,
                            $key
                        )
                    ) : static::getByPath($array, $key);
                    $compare2 = is_object($val) ? get_object_vars($val) : $val;

                    $results[] = ($compare1 == $compare2);
                }
            }
        }

        // Must all TRUE.
        return !in_array(false, $results, true);
    }
public static function match($array, array $queries, $strict = false)
    {
        $results = [];

        // Visit Query Rules
        foreach ($queries as $key => $val) {
            if (substr($key, -2) === '>=') {
                $results[] = (static::getByPath($array, trim(substr($key, 0, -2))) >= $val);
            } elseif (substr($key, -2) === '<=') {
                $results[] = (static::getByPath($array, trim(substr($key, 0, -2))) <= $val);
            } elseif (substr($key, -1) === '>') {
                $results[] = (static::getByPath($array, trim(substr($key, 0, -1))) > $val);
            } elseif (substr($key, -1) === '<') {
                $results[] = (static::getByPath($array, trim(substr($key, 0, -1))) < $val);
            } elseif (is_array($val)) {
                $results[] = in_array(static::getByPath($array, $key), $val, $strict);
            } else {
                if ($strict) {
                    $results[] = (static::getByPath($array, $key) === $val);
                } else {
                    // Workaround for PHP object compare bug, see: https://bugs.php.net/bug.php?id=62976
                    $compare1 = is_object(static::getByPath($array, $key)) ? get_object_vars(
                        static::getByPath(
                            $array,
                            $key
                        )
                    ) : static::getByPath($array, $key);
                    $compare2 = is_object($val) ? get_object_vars($val) : $val;

                    $results[] = ($compare1 == $compare2);
                }
            }
        }

        // Must all TRUE.
        return !in_array(false, $results, true);
    }
public static function match ( $ array , array $ queries , $ strict = false ) { $ results = [ ] ; // Visit Query Rules foreach ( $ queries as $ key => $ val ) { if ( substr ( $ key , - 2 ) === '>=' ) { $ results [ ] = ( static :: getByPath ( $ array , trim ( substr ( $ key , 0 , - 2 ) ) ) >= $ val ) ; } elseif ( substr ( $ key , - 2 ) === '<=' ) { $ results [ ] = ( static :: getByPath ( $ array , trim ( substr ( $ key , 0 , - 2 ) ) ) <= $ val ) ; } elseif ( substr ( $ key , - 1 ) === '>' ) { $ results [ ] = ( static :: getByPath ( $ array , trim ( substr ( $ key , 0 , - 1 ) ) ) > $ val ) ; } elseif ( substr ( $ key , - 1 ) === '<' ) { $ results [ ] = ( static :: getByPath ( $ array , trim ( substr ( $ key , 0 , - 1 ) ) ) < $ val ) ; } elseif ( is_array ( $ val ) ) { $ results [ ] = in_array ( static :: getByPath ( $ array , $ key ) , $ val , $ strict ) ; } else { if ( $ strict ) { $ results [ ] = ( static :: getByPath ( $ array , $ key ) === $ val ) ; } else { // Workaround for PHP object compare bug, see: https://bugs.php.net/bug.php?id=62976 $ compare1 = is_object ( static :: getByPath ( $ array , $ key ) ) ? get_object_vars ( static :: getByPath ( $ array , $ key ) ) : static :: getByPath ( $ array , $ key ) ; $ compare2 = is_object ( $ val ) ? get_object_vars ( $ val ) : $ val ; $ results [ ] = ( $ compare1 == $ compare2 ) ; } } } // Must all TRUE. return ! in_array ( false , $ results , true ) ; }
Check an array match our query.

@param   array   $array   An array to query.
@param   array   $queries Query strings or callback, may contain Comparison Operators: '>', '>=', '<', '<='.
@param   boolean $strict  Use strict to compare equals.

@return  bool
Check an array match our query .