Reputation: 21
I have set of strings where some of them are made of non-ascii characters. How do I get strings with only ascii characters using a php script.
Thanks a lot in advance for any guidance..
Upvotes: 1
Views: 2698
Reputation: 18041
<?php
echo preg_replace('/[^(\x20-\x7F)]*/', '', 'Standard ASCII and some gärbägè');
?>
Upvotes: 5