note 47784 added to function.iconv

From: Date: Tue, 30 Nov 2004 04:20:41 +0000
Subject: note 47784 added to function.iconv
Groups: php.notes 
Request: Send a blank email to php-notes+get-81172@lists.php.net to get a copy of this message
For those who have troubles in displaying UCS-2 data on browser, here's a simple function that convert ucs2 to html unicode entities : <?php function ucs2html($str) { $str=trim($str); // if you are reading from file $len=strlen($str); $html=''; for($i=0;$i<$len;$i+=2) $html.='&#'.hexdec(dechex(ord($str[$i+1])). sprintf("%02s",dechex(ord($str[$i])))).';'; return($html); } ?> ---- Manual Page -- http://www.php.net/manual/en/function.iconv.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47784 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47784&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47784&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47784&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47784&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47784&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47784&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47784&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#81172) next »