string count_chars(string $str [, int $mode])
(PHP 4, PHP 5)
| $str | The string value to be encoded |
|---|---|
| $mode | The type of character counting to perform (see key below) |
| RETURNS | Returns the encoded character string. |
Possible Values for $mode
Search the source string and compile statistics based on what characters were found in the string and (optionally), which were not. Unless you need to do some statistic analysis on frequency of characters found in a source string, this function will not be of much use to you.
echo count_chars($input, 3);