note 83051 added to function.utf8-decode
| From: | haugas at gmail dot com | Date: | Thu, 08 May 2008 09:11:34 +0000 |
| Subject: | note 83051 added to function.utf8-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139170@lists.php.net to get a copy of this message | ||
If you don't know exactly, how many times your string is encoded, you can use this function:
<?php
function _utf8_decode($string)
{
$tmp = $string;
$count = 0;
while (mb_detect_encoding($tmp)=="UTF-8")
{
$tmp = utf8_decode($tmp);
$count++;
}
for ($i = 0; $i < $count-1 ; $i++)
{
$string = utf8_decode($string);
}
return $string;
}
?>
----
Server IP: 212.47.220.13
Probable Submitter: 88.196.213.181
----
Manual Page -- http://www.php.net/manual/en/function.utf8-decode.php
Edit -- https://master.php.net/note/edit/83051
Del: integrated -- https://master.php.net/note/delete/83051/integrated
Del: useless -- https://master.php.net/note/delete/83051/useless
Del: bad code -- https://master.php.net/note/delete/83051/bad+code
Del: spam -- https://master.php.net/note/delete/83051/spam
Del: non-english -- https://master.php.net/note/delete/83051/non-english
Del: in docs -- https://master.php.net/note/delete/83051/in+docs
Del: other reasons-- https://master.php.net/note/delete/83051
Reject -- https://master.php.net/note/reject/83051
Search -- https://master.php.net/manage/user-notes.php