In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Joe Stump) wrote:
> Look at the chr() function - figure out what the character is (number wise)
> and
> then do an ereg_replace(chr(),'',$string) (from the hip - you can do a
> replace
> with chr() on one of the replaces, I've done it before)
>
> --Joe
>
> On Sun, Feb 25, 2001 at 12:34:21AM -0500, Clayton Dukes wrote:
> >
> > How do I remove unwanted/unprintable characters from a variable?
> >
> > $sometext = "ThÀe cØar röøan over mÖy dog"
> > needs to be filtered and reprinted as:
> > "The car ran over my dog"
And you might also want to look at strtr()
<http://php.net/manual/en/function.strtr.php>. You could, I suppose, use
it to substitute some character that you know would never legitimately
appear in $sometext, then do a straight str_replace() on the string for all
occurences of that character.
--
CC
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]