note 76331 added to function.utf8-encode
| From: | vita dot plachy at seznam dot cz | Date: | Tue, 10 Jul 2007 23:40:20 +0000 |
| Subject: | note 76331 added to function.utf8-encode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128369@lists.php.net to get a copy of this message | ||
Tato funkce Åešà problém s pÅevodem Äeských znaků. Seznam je Åazen tak,
aby znaky s náhradami nekolidovaly.
<?php
function utf8_encode_cs($text)
{
$znaky=array(
array("Ä", 196, 155),
array("Å¡", 197, 161),
array("Å", 197, 153),
array("ý", 195, 189),
array("á", 195, 161),
array("Ã", 195, 173),
array("é", 195, 169),
array("ú", 195, 186),
array("ů", 197, 175),
array("Ä", 196, 143),
array("Å¥", 197, 165),
array("Å", 197, 136),
array("ó", 195, 179),
array("Ä", 196, 154),
array("Å ", 197, 160),
array("Ä", 196, 140),
array("Å", 197, 152),
array("Ã", 195, 129),
array("Ã", 195, 137),
array("Ť", 197, 164),
array("Å", 197, 135),
array("Ã", 195, 147),
array("Ã", 195, 157),
array("Ã", 195, 154),
array("Å®", 197, 174),
array("Ã", 195, 141),
array("ž", 197, 190),
array("Ž", 197, 189),
array("Ä", 196, 141),
array("Ä", 196, 142)
);
$text=utf8_encode($text);
for($i=0; $i<count($znaky); $i++)
$text=ereg_replace(utf8_encode($znaky[$i][0]), chr($znaky[$i][1]) . chr($znaky[$i][2]), $text);
return $text;
}
echo utf8_encode_cs("LoÄ ÄeÅà kýlem tůŠobzvlášť v Grónské
úžinÄ.");
?>
----
Server IP: 147.32.160.17
Probable Submitter: 213.29.65.108
----
Manual Page -- http://www.php.net/manual/en/function.utf8-encode.php
Edit -- https://master.php.net/note/edit/76331
Del: integrated -- https://master.php.net/note/delete/76331/integrated
Del: useless -- https://master.php.net/note/delete/76331/useless
Del: bad code -- https://master.php.net/note/delete/76331/bad+code
Del: spam -- https://master.php.net/note/delete/76331/spam
Del: non-english -- https://master.php.net/note/delete/76331/non-english
Del: in docs -- https://master.php.net/note/delete/76331/in+docs
Del: other reasons-- https://master.php.net/note/delete/76331
Reject -- https://master.php.net/note/reject/76331
Search -- https://master.php.net/manage/user-notes.php