PHP uses iconv () function to solve UNICODE coded UTF-8 character set.

time:10-07-15 forum:PHP tools and code
  Reprinted from http://www.kalvin.cn/? Action=show.amp; id=239

[code].lt;
function uni_decode ($s) {
preg_match_all. = array_merge ($html_uni.#91; 0.#93; $js_uni.#91; 0.#93;);
$js = array ($i=0; $i.lt; $i.lt);
$code = $s;
for ($j=0; $j.lt; count ($utf8); $j) );
}

function unicode2utf8 ($c) {
$str=.quot;.Quot;
if.
} else if ($c.Lt; 0x10000) {
$str.=chr (0xe0 $c.gt;.Gt; 12);
$str.=chr (0x80 $c.gt;.Gt; 12.Amp; 0x3f);
$str.=chr (.Gt; > > > > > > > > > > I am the soul! .lt; br /.gt; \u8FD9\u662F\u6D4B\u8BD5\u6587\u672C\uFF01';
echo uni_decode ($str); / / everyone, I am a lonely soul! This is the test text!
?.gt; [/code]

prev: next:Conversion of GB2312 and Unicode code in...
post comment
Notice



approved   Good dad's 7 standards, all perfect!   The son spoke softly, afraid of skin...   After 50 years of age, it is difficu...      President of Western Europe: it is n...
rand   Cross domain call COOKIES   Implementation of escape decoding fu...   PHP decryption of Unicode coded char...   PHP to get the breakpoint renewal co...   How to optimize Mysql tens of millio...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com