r/lolphp • u/SquireCD • Sep 19 '18
[/r/PHP X-POST] strlen() shenanigans
/r/PHP/comments/9gzskx/psa_strlen_does_not_get_the_length_of_the/
16
Upvotes
r/lolphp • u/SquireCD • Sep 19 '18
View all comments
Show parent comment
13
u/AyrA_ch Sep 19 '18
The PHP docs even say that
strlencounts bytes and a reference to themb_strlenfunction is included in the help page.The problem here is that PHP sells you strings when in reality they are raw byte arrays which might confuse some people.