Which PHP function returns the number of bytes in a string?
Correct answer
D. strlen()
17 views
D. strlen()
17 views
strlen() counts bytes, so for multibyte UTF-8 text such as Urdu use mb_strlen(). count() and its alias sizeof() count array elements, and length() does not exist in PHP.
Asked in: NTS, PPSC, PHP Developer Interviews
Not sure why the answer is D? Ask here and get an explanation.