Tool that removes non-ASCII characters from input

Sometimes it’s necessary to remove particular characters, say those that belong to some local encoding, from an input. And sometimes we may be curious as what is output of preg_replace('/[^(\x20-\x7F)]*/','',’’, $str[0]))

preg_replace is a PHP function that performs a regular expression search and replace.

 

Code example

<?php //execute preg_replace $str[] = "<<>>//ÓÝ$"; echo "<div><h2>The result is following</h2>". htmlspecialchars(preg_replace('/[^(\x20-\x7F)]*/','', $str[0]))."</div>"; ?>

Other tools & help

If you need help with PHP scripting, Apache setup and server-related situations, drop me a line. You’re also welcome to visit other tools - they’re listed below.