PHP uses the iconv () function to transform Unicode encoding into UTF-8 code that can be browsed.

time:10-07-14 forum:PHP tools and code
  Reprinted from http://subin.org.cn/blog/post/464.html

[code].lt; php
function unicode_encode ($name) {
$name = iconv. ;
$c2 = $name.#91; $i 1.#93;
if (ord ($c).Gt; 0)

function unicode_decode ($name)
{

if (! Empty ($matches))
{
$name =; 2, 2), 16, 10);
$code2 = base_convert (substr ($str, 4), 16, 10);
$c = Chr ($code).Chr ($code2); Icode_decode ('\u0068\u0074\u0074\u0070').'.lt; /h3.gt;';

$name ='subin';

echo'.lt;
  • 2

prev:PHP encryption and decryption thunder, F... next:
post comment
Notice



approved   Ji'nan will open 58 tour bus lines. ...   Media undercover tea market explosio...   Will the bonus be divided, which wil...   Before buying a house, buying a hous...   "Your advice really can't help me." ...
rand   PHP determines the character functio...   Put URL shortcuts on the PHP code on...   Cross domain call COOKIES   Implementation of escape decoding fu...   PHP decryption of Unicode coded char...
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