class ascii
{
function decode($str)
{
preg_match_all( "/(d{
$a = $a[
foreach ($a as $dec)
{
if ($dec <
{
$utf
}
else if ($dec <
{
$utf
$utf
}
else
{
$utf
$utf
$utf
}
}
return $utf;
}
function encode($c)
{
$len = strlen($c);
$a =
while ($a < $len)
{
$ud =
if (ord($c{$a}) >=
{
$ud = ord($c{$a});
$a +=
}
else if (ord($c{$a}) >=
{
$ud = (ord($c{$a})
$a +=
}
else if (ord($c{$a}) >=
{
$ud = (ord($c{$a})
$a +=
}
else if (ord($c{$a}) >=
{
$ud = (ord($c{$a})
$a +=
}
else if (ord($c{$a}) >=
{
$ud = (ord($c{$a})
$a +=
}
else if (ord($c{$a}) >=
{
$ud = (ord($c{$a})
$a +=
}
else if (ord($c{$a}) >=
{ //error
$ud = false;
}
$scill
}
return $scill;
}
From:http://tw.wingwit.com/Article/program/PHP/201311/20893.html