Articles

Regex to remove non ascii characters

Remove non ascii characters from a string with the following rgex

$new = preg_replace("/[^\x9\xA\xD\x20-\x7F]/", "", $old);