Reply to Re: Removing nonlatin characters

Your name:

Reply:


Posted by Rene Brehmer on 06/29/05 23:51

Documented research indicate that on Sat, 25 Jun 2005 01:27:13 +0300, Dotan
Cohen wrote:

> I thought that this was another old STFA but marc and google are quiet.
>
> I as parsing a bunch of submitted works and some of them have
> non-latin characters. I know that I once saw in the user-submitted
> notes in the docs a function for replacing them with o,a,i,e,u but I
> can't find it. I think that it may have been purged. Can anyone help?

I think you mean something like this:

function stripAccents($string) {
$returnString = strtr($string,
'àáâãäçèéêëìíîïñòóôõöšùúûüýÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖŠÙÚÛÜÝ',
'aaaaaceeeeiiiinooooosuuuuyAAAAACEEEEIIIINOOOOOSUUUUY');
$returnString =
str_replace('æ','ae',str_replace('Æ','AE',$returnString));
$returnString =
str_replace('ø','oe',str_replace('Ø','OE',$returnString));
$returnString = str_replace('ß','ss',$returnString);
return $returnString;
}

This function is part using code once posted on this list, part my own
creation.

HTH

Rene

--
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising!

http://metalbunny.net/
My little mess of things...

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация