Test if an array contains value(s)

@param string|array $aValues The values to check for
@param array        $aArray  The array to search

@return bool
324479
public static function inArray($aValues, array $aArray): bool
    {
        if (is_string($aValues)) {
            $aValues = (array) $aValues;
        }

        foreach ($aValues as $sValue) {
            if (in_array($sValue, $aArray)) {
                return true;
            }
        }
        return false;
    }
203572
public static function containsNotAnyKey(array $arr, array $keys)
    {
        foreach ($keys as $key) {
            if (isset($arr[$key]))
                return false;
        }

        return true;
    }
463395
protected function _checkArrValuesEmpty($aData, $aKeys)
    {
        if (!is_array($aKeys) || count($aKeys) < 1) {
            return false;
        }

        foreach ($aKeys as $sKey) {
            if (isset($aData[$sKey]) && !empty($aData[$sKey])) {
                return false;
            }
        }

        return true;
    }
240089
public static function keysExist(array $arr /*, $key1, $key2, etc...*/){
		
		for($i = 1, $l = \func_num_args() - 1; $i <= $l; ++$i){
			if(!\array_key_exists(\func_get_arg($i), $arr)){
				return false;
			}
		}
		
		return true;
		
	}
572316
public static function IsSingleDepth( array $array ) : bool
   {

      if ( \count( $array ) < 1 )
      {
         return false;
      }

      foreach ( $array as $v )
      {
         if ( \is_array( $v ) && \count( $v ) > 0 )
         {
            return false;
         }
      }

      return true;

   }
1039218
public function equal(SplFixedArray $array):bool{

		if($this->count() !== $array->count()){
			return false;
		}

		$diff = 0;

		foreach($this as $k => $v){
			$diff |= $v ^ $array[$k];
		}

		$diff = ($diff - 1) >> 31;

		return ($diff & 1) === 1;
	}
831585
public function containsAttributes(array $attributes)
    {
        foreach ($attributes as $attribute) {
            if (!$this->attributes->contains($attribute)) {
                return false;
            }
        }

        return true;
    }
1004966
public static function containsAllKeys(array $arr, array $keys)
    {
        foreach($keys as $key)
        {
            if( !isset( $arr[$key] ) )
                return false;
        }

        return true;
    }
784433
function has (array, val) {
  var rtn = false;
  if (Array.isArray(array)) {
    rtn = !!~array.indexOf(val);
  }
  return rtn;
}
515020
public static function hasKey(Array $array, Array $keys)
    {
        foreach ($array as $key => $value) {
            if (in_array($key, $keys)) {
                return true;
            }
        }

        return false;
    }
883638
function contains($item, callable $callback = null) {
        if ($callback === null) {
            $callback = __NAMESPACE__ . '\\compare';
        }
        foreach ($this->avl as $pair) {
            /**
             * @var Pair $pair
             */
            if (call_user_func($callback, $pair->second, $item) === 0) {
                return true;
            }
        }

        return false;
    }
238382
protected function isArrayValueArray($array)
    {
        if (!is_array($array)) {
            return false;
        }
        foreach ($array as $k => $v) {
            if (!is_array($v)) {
                return false;
            }
        }

        return true;
    }
1157910
public static function set(&$aArray, $mFind, $mValue = null)
    {
        if (is_null($mFind)) {
            $aArray = !is_null($mValue) ? $mValue : $aArray;
            return;
        }

        if (is_array($mFind)) {
            foreach ($mFind as $key => $value) {
                self::set($aArray, $key, $value);
            }
        } else {
            $keys = explode('.', $mFind);

            while (count($keys) > 1) {
                $mFind = array_shift($keys);

                if (!isset($aArray[$mFind]) || !is_array($aArray[$mFind])) {
                    $aArray[$mFind] = array();
                }

                $aArray =& $aArray[$mFind];
            }

            $aArray[reset($keys)] = $mValue;
        }
    }
1159809
private function matches($table, $arr)
    {
        $match = false;

        foreach ($arr as $pattern) {
            if ('/' != $pattern[0]) {
                continue;
            }
            if (1 == preg_match($pattern, $table)) {
                $match = true;
            }
        }

        return in_array($table, $arr) || $match;
    }
1227208
public function containsAnyOf(array $elements): bool
    {
        if (!is_scalar($this->value) || null === $this->value) {
            return false;
        }

        foreach ($elements as $needle) {
            if (is_bool($needle) && $this->value === $needle) {
                return true;
            } elseif (!is_bool($needle) && ($this->value === $needle || (is_string($this->value) && false !== strpos($this->value, (string) $needle)))) {
                return true;
            }
        }

        return false;
    }
249095
public static function aIntersec($iArray, $allowArray = array()) {

        try {        
            $return = $iArray; 
            // if empty do not filter the array
            if (!empty($allowArray)) {
                $return = array_intersect_key($iArray, array_flip($allowArray)); 
            }   
            return $return; 
        } catch (Exception $e) {
            echo $e->getTraceAsString();
        }        
        
    }
785629
public static function contains(string $string, $values): bool
    {
        foreach ((array) $values as $value) {
            if (strpos($string, $value) !== false) {
                return true;
            }
        }

        return false;
    }