If I want to open the hexadecimal equivalent of space in PHP, I can play with bin2hex :
php > echo var_dump(bin2hex(" ")); string(2) "20"
I can also get the space character from "20"
php > echo var_dump(hex2bin("20")); string(1) " "
But there are Unicode versions for the "visible" space:
php > echo var_dump(hex2bin('c2a0')); string(2) " "
So, I can get some line (for example, from HTTP requests), where I can not recognize "without spaces" with my eyes. So,...
$string = preg_replace('~\x{00a0}~siu', ' ', $string);
Is there a better way to find and replace all โlikeโ characters with PHP?
php regex
sensorario
source share