September 2001
Intermediate to advanced
768 pages
32h 45m
English
mixed count_chars(string string, [int mode])
Gets information about the characters used in a string.
Returns:
Array or string containing character information; FALSE if the mode parameter is less than 0 or greater than 4
Description:
count_chars() counts the number of times that an ASCII character occurs within a string and returns the information in one of five possible ways.
The optional parameter mode defaults to 0. Depending on mode , count_chars() returns one of the following:
| Value | Description |
|---|---|
| 0 | An array with the byte value as key and the frequency of every byte as value |
| 1 | Like 0, but only byte values with a frequency greater than zero are listed |
| 2 | Like 0, but only byte values with a frequency equal to zero are listed |
Read now
Unlock full access