Hi there,
I am still searching for a function which is replacing all chars not between
[a-z] for exampe a province name like: minºaqah-ash-shamal¿yah into valid
chars or just deleting them. There seems to be an endless amount of those
chars.
Thanx for any hint,
andy
--
PHP General Mailing
>I am still searching for a function which is replacing all chars not between
>[a-z] for exampe a province name like: minºaqah-ash-shamal¿yah into valid
>chars or just deleting them. There seems to be an endless amount of those
>chars.
This grep pattern: [\x80-\xFF]
will match any high byte ch
»andy« sagte am 2002-03-18 um 14:22:47 +0100 :
> Hi there,
>
> I am still searching for a function which is replacing all chars not between
> [a-z] for exampe a province name like: minºaqah-ash-shamal¿yah into valid
> chars or just deleting them. There seems to be an endless amount of those
> ch
»Rasmus Lerdorf« sagte am 2002-03-18 um 07:12:21 -0800 :
> $new = preg_replace('/[^a-z]/i','',$old);
>
> Note that this will also get rid of the - in this case since you
> specifically asked for something that got rid of everything not a-z
Yes. And to not get rid of the -, you need to specify i
so whats the difference between yours and :
$filename = ereg_replace ("[^a-z^0-9^/.^=^/-]", "", $filename);
Andy
"Alexander Skwar" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
»Rasmus Lerdorf« sagte am 2002-03-18 um 07:12:21 -0800 :
> $new = preg_replac
»andy« sagte am 2002-03-18 um 17:00:16 +0100 :
> so whats the difference between yours and :
> $filename = ereg_replace ("[^a-z^0-9^/.^=^/-]", "", $filename);
You've got quite some ^ to much in there, I'd think. If I understand it
correctly, you'd also not remove the ^ character, because you've
6 matches
Mail list logo