php regex non printable characters
snippet in php

php regex non printable characters

user7107

myprompt> php -a
Interactive shell

php > $string = "‘Hello,’ she said.";
php > $result = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $string);
php > echo $result;
Hello, she said.

php regex non printable characters

user8581

$result = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $string);