Remove non-utf8 characters from string
User login
Tuesday, July 23, 2013 - 17:41
Here is a nice little PHP snippet that will remove non-ASCII characters from a String.
<?php
$string = "Remove these characters: รครณ";
$string = preg_replace('/[^(\x20-\x7F)]*/','', $string);
?>
Code was taken from here.
Tags:
PHP / MySQL