php get string length functionstrlen
andmb_strlen
count()
- Count in the array The number of units, or the number of attributes in the objectstrlen
- Get the length of the string, a Chinese character is 3 charactersmb_strlen()
- Get the length of the string
-----------
int strlen (string $string)
Returns the length of string if successful; if string is empty, returns 0.
Example
Note:
strlen() returns the number of bytes rather than the number of characters in a string.
strlen() returns NULL when executed on arrays, and an E_WARNING level error is emitted.
For more PHP-related technical articles, please visit thePHP Tutorialcolumn to learn!
The above is the detailed content of Which function in php can get the length of a string?. For more information, please follow other related articles on the PHP Chinese website!