application/Espo/Core/Utils/File/Permission.php
protected function getSearchCount($search, array $array)
    {
        $search = $this->getPregQuote($search);

        $number = 0;
        foreach ($array as $value) {
            if (preg_match('/^'.$search.'/', $value)) {
                $number++;
            }
        }

        return $number;
    }
protected function getSearchCount($search, array $array)
    {
        $search = $this->getPregQuote($search);

        $number = 0;
        foreach ($array as $value) {
            if (preg_match('/^'.$search.'/', $value)) {
                $number++;
            }
        }

        return $number;
    }
protected function getSearchCount ( $ search , array $ array ) { $ search = $ this -> getPregQuote ( $ search ) ; $ number = 0 ; foreach ( $ array as $ value ) { if ( preg_match ( '/^' . $ search . '/' , $ value ) ) { $ number ++ ; } } return $ number ; }
Get count of a search string in a array

@param  string $search
@param  array  $array
@return bool
Get count of a search string in a array