Strip non-ASCII characters from a String
Platform: PHP
Published Mar 31, 2008
Updated Mar 31, 2008
This is a little snippet that will remove any non-ASCII characters from a string.
<?php
$string = "Remove these characters: รครณ";
$string = preg_replace('/[^(\x20-\x7F)]*/','', $string);
?>