Quick Search:
 
 PHP Code: Remove all non-ASCII chars Jump to:  
Category: >> PHP Code >> Remove all non-ASCII chars  

<< lastnext >>

Snippet Name: Remove all non-ASCII chars

Description: Removes all non-ASCII chars (like "ã", "ô", "ç", etc). Great for sanitizing input strings.

Comment: (none)

Language: PHP
Highlight Mode: PHP
Last Modified: March 01st, 2009

<?PHP
 
$string = "Remove these characters: ã ç ó ô";
$string = PREG_REPLACE('/[^(\x20-\x7F)]*/','', $string);
 
?>


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org