I tried to delete the space, did not work, went to the documentation and ...
It may seem strange that the result of calling
trim(html_entity_decode(' '));
is not an empty string. The reason is that
is not converted to a character with ASCII code 32 (which is removed by thetrim()
function), but to a character with ASCII code 160 (0xa0) in the default ISO-8859-1 encoding.
I thought, what if I checked which character the function would print
ord(html_entity_decode(' '))
Hoping to get the character code 160, I got 194 ...
How? And the funny thing is that chr(194)
is a broken character.