src/Common/CodeIgniter/Libraries/FormValidation.php
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;
    }
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;
    }
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 ; }
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
Checks if an array satisfies specified count restrictions .