Reputation: 3320
I see this question has been asked a few times but I couldn't find an answer in php.
I have the following string.
$myString = " LLC."
I run this trim($myString)
;
and I get this back " LLC."
according to the trim documentation it should delete the white space in the front and the back? What am I missing?
I also tried htis trim($myString, " ");
same results
Upvotes: 0
Views: 66
Reputation: 48751
The e2808d
at the beginning of bin2hex()
output is ZERO WIDTH JOINER
character and the reason for trim()
to not trim it. Try (PHP 7):
echo trim($myString, "\u{200d} \t\n\r\0\x0B");
Upvotes: 2
Reputation: 1158
I think this is happening because of the empty space is not really a real white space (tab) looks like a hidden character (â). i copy your variable and value code into an online PHP editor and i got this:
Upvotes: 0