I have HTML code like:
-
if you got 8 bit ASCII, is will remove them and keep the chars in range 128-255
$text = preg_replace('/[\x00-\x1F\xFF]/', " ", $text );
If you have a UTF-8 encoded string is will do the work
$text = preg_replace('/[\x00-\x1F\x7F]/u', '', $text);
for more information
you have this link
more information
- 热议问题