Reply to Function that convert national characters into ASCII

Your name:

Reply:


Posted by Wiktor on 10/19/05 19:10

Hi,

Is there a function that will convert any european special characters
into standard ASCII letters eg. polish "ogonki" into a,e,o or german umlauts into
ue,oe...?

something better than this...

//only PL chars
function Utf2Ascii($string)
{
$utf2ascii = array(
"\xC4\x84"=>"A",
"\xC4\x85"=>"a",
"\xC4\x86"=>"C",
"\xC4\x87"=>"c",
"\xC4\x98"=>"E",
"\xC4\x99"=>"e",
"\xC5\x81"=>"L",
"\xC5\x82"=>"l",
"\xC5\x83"=>"N",
"\xC5\x84"=>"n",
"\xC3\x93"=>"O",
"\xC3\xB3"=>"o",
"\xC5\x9A"=>"S",
"\xC5\x9B"=>"s",
"\xC5\xB9"=>"Z",
"\xC5\xBA"=>"z",
"\xC5\xBB"=>"Z",
"\xC5\xBC"=>"z",
);
return strtr($string, $utf2ascii);
}


--
Excuse my english ;)

Pozdrowienia,
Wiktor

[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

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