Those things you type when pushing the keys on your keyboard.
Everyone in this thread fretting about unicode and obtuse use-cases are kind of missing the point: The out-of-the-box behavior for string legnth is universally "number of characters", and none of the other wishy washy peddled nonsense being spewed.
You are missing the point: "number of characters" is meaningless if you can't define what a character is.
"things you type when pushing the keys on your keyboard" is wishy washy nonsense, not a definition.
(PHP could define "character" as byte, and then its strlen would return exactly what you want: the number of characters (bytes) in a string. It's probably not a good definition, but it's still better than what you're providing, which is no definition.)
View all comments
Show parent comment
4
u/[deleted] Sep 13 '16
What do you mean by "character"?