Re: stripping high ascii from a string
| From: | CC Zona | Date: | Tue, 08 Jan 2002 22:00:48 +0000 |
| Subject: | Re: stripping high ascii from a string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-79825@lists.php.net to get a copy of this message | ||
In article <3C3B66BC.E7C6A690@billtron.com>, bill@billtron.com (Bill)
wrote:
> Is there a function that can strip high ascii from a string?
How about a regex? preg_replace() supports matching on octal or hex ranges
<http://www.php.net/manual/en/pcre.pattern.syntax.php>,
so perhaps one of
these...?
$newstring=preg_replace('/[\200-\377]/','',$oldstring); //octal
$newstring=preg_replace('/[\x80-\xff]/','',$oldstring); //hex
--
CC