src/S.php
public static function countChars($string, array $chars)
    {
        if (function_exists('mb_split')) {
            return count(mb_split('('.implode('|', $chars).')', $string)) - 1;
        }

        $counter = 0;
        foreach ($chars as $char) {
            $counter += substr_count($string, $char);
        }
        return $counter;
    }
public static function countChars($string, array $chars)
    {
        if (function_exists('mb_split')) {
            return count(mb_split('('.implode('|', $chars).')', $string)) - 1;
        }

        $counter = 0;
        foreach ($chars as $char) {
            $counter += substr_count($string, $char);
        }
        return $counter;
    }
multiple substr_count().
@param $string
@param array $chars
@return bool|int