Logo

Programming-Idioms

History of Idiom 169 > diff from v35 to v36

Edit summary for version 36 by programming-idioms.org:
Admin deletes impl 2267

Version 35

2018-04-06, 20:06:49

Version 36

2018-04-06, 20:07:25

Idiom #169 String length

Assign to integer n the number of characters of string s.

This can be different from the number of bytes of s.

Idiom #169 String length

Assign to integer n the number of characters of string s.

This can be different from the number of bytes of s.

Extra Keywords
size
Extra Keywords
size
Code
$n = strlen($s);
Comments bubble
strlen() returns the number of bytes rather than the number of characters in a string.
Doc URL
http://php.net/manual/en/function.strlen.php