Checks if an array satisfies specified count restrictions.

@param array  $aArray The value to check
@param string $sParam The parameter to check against

@return boolean
778998
public function item_count(array $aArray, $sParam)
    {
        $aParams  = preg_replace('/[^0-9]/', '', explode(',', $sParam));
        $mFloor   = ArrayHelper::getFromArray(0, $aParams, 0);
        $mCeiling = ArrayHelper::getFromArray(1, $aParams, INF);

        if (substr($sParam, 0, 1) === '(' && substr($sParam, -1, 1) === ')') {
            $mFloor++;
            $mCeiling--;
        }

        if (($bAboveFloor = $mFloor <= count($aArray)) === false) {
            $this->set_message('item_count', lang('fv_count_floor'));
        }

        if (($bBeneathCeiling = $mCeiling >= count($aArray)) === false) {
            $this->set_message('item_count', lang('fv_count_ceiling'));
        }

        return $bAboveFloor && $bBeneathCeiling;
    }
1055474
public static function isList(array $array, $strict = false)
    {
        $isNumbers = ctype_digit(implode('', array_keys($array)));

        if (!$strict) {
            return $isNumbers;
        } elseif (!$isNumbers) {
            return false;
        }

        return array_keys($array) === range(0, count($array) - 1);
    }
269161
static function stringContainsWord($str, array $arr)
    {
        foreach($arr as $a) {
            if (stripos($str,$a) !== false) return true;
        }
        return false;
    }
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;

   }
110329
function arrayIncludes(arr, v) {
  for (let i = 0, len = arr.length; i < len; i++) {
    const av = arr[i];

    if (Tyr.isEqual(av, v)) {
      return true;
    }
  }

  return false;
}
1019985
public function isArray(): bool
    {
        return (bool) $this->docBlockUtility->getConstraint($this->property, All::class, false);
    }
440371
public static function arraySearchMulti($sValue, $sKey, array $aArray)
    {
        foreach ($aArray as $k => $val) {

            if (is_array($val)) {

                if ($val[$sKey] == $sValue) {
                    return $k;
                }

            } elseif (is_object($val)) {
                if ($val->$sKey == $sValue) {
                    return $k;
                }
            }
        }
        return false;
    }
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;
    }
97154
public static boolean haveEqualSets(int[] arra, int[] arrb, int count) {

        if (ArrayUtil.haveEqualArrays(arra, arrb, count)) {
            return true;
        }

        if (count > arra.length || count > arrb.length) {
            return false;
        }

        if (count == 1) {
            return arra[0] == arrb[0];
        }

        int[] tempa = (int[]) resizeArray(arra, count);
        int[] tempb = (int[]) resizeArray(arrb, count);

        sortArray(tempa);
        sortArray(tempb);

        for (int j = 0; j < count; j++) {
            if (tempa[j] != tempb[j]) {
                return false;
            }
        }

        return true;
    }
377022
public static function isValidExtension(string $str, array $arr) : bool
    {
        $fE = explode(".", $str);
        $fE = "." . $fE[count($fE) - 1];

        return in_array($fE, $arr);
    }
729093
public function checkRequired(array $arr){
        //Filter out null values
        $filtered = $this->filterNull($arr);
        
        if(isset($this->required_trans))
            throw new MissingRequiredFieldsException;
        
        //check if all required fields are present
        return count(array_intersect_key(array_flip($this->required_trans), $filtered)) === count($this->required_trans);
    }
108060
public static int countTrueElements(boolean[] arra) {

        int count = 0;

        for (int i = 0; i < arra.length; i++) {
            if (arra[i]) {
                count++;
            }
        }

        return count;
    }
714859
private function doesKeySatisfyRestrictions(array $restrictions, JWKInterface $key)
    {
        foreach ($restrictions as $k => $v) {
            if (!$key->has($k) || $v !== $key->get($k)) {
                return false;
            }
        }

        return true;
    }
1072913
protected function isNumericallyIndexedArray(array $phpArray): bool
    {
        foreach (array_keys($phpArray) as $key) {
            if (is_numeric($key) === false) {
                return false;
            }
        }
        return true;
    }
504336
function isAlphaNumericArray( value ) {
	var len;
	if ( !isArray( value ) ) {
		return false;
	}
	len = value.length;
	if ( !len ) {
		return false;
	}
	for ( var i = 0; i < len; i++ ) {
		if ( !isAlphaNumeric( value[i] ) ) {
			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;
		
	}
121179
public function is_unique($sString, $sParameters)
    {
        $aParameters   = explode('.', $sParameters);
        $sTable        = ArrayHelper::getFromArray(0, $aParameters);
        $sColumn       = ArrayHelper::getFromArray(1, $aParameters);
        $sIgnoreId     = ArrayHelper::getFromArray(2, $aParameters);
        $sIgnoreColumn = ArrayHelper::getFromArray(3, $aParameters, 'id');

        $oDb = Factory::service('Database');
        $oDb->where($sColumn, $sString);
        if ($sIgnoreId) {
            $oDb->where($sIgnoreColumn . ' !=', $sIgnoreId);
        }
        return $oDb->count_all_results($sTable) === 0;
    }