首页/技术开发/内容

贴段PHP画图的程序,给希望用PHP作图的朋友一些启发,帮助!

技术开发2024-12-18 阅读()
[摘要]c & 0x3F);return str;function gb2unicode(gb)if(!trim(gb))return gb;filename="gb2312.txt&qu...
$c & 0x3F);
}

return $str;
}


function gb2unicode($gb){
if(!trim($gb))
return $gb;

$filename="gb2312.txt";
$tmp=file($filename);
$codetable=array();

while(list($key,$value)=each($tmp))
$codetable[hexdec(substr($value,0,6))]=substr($value,9,4);
$utf="";
while($gb){
if (ord(substr($gb,0,1))>127){
$this=substr($gb,0,2);
$gb=substr($gb,2,strlen($gb));
$utf.="&#x".$codetable[hexdec(bin2hex($this))-0x8080].";";
}
else{
$gb=substr($gb,1,strlen($gb));
$utf.=substr($gb,0,1);
}
}
return $utf;
}
?>

第1页  第2页  第3页  第4页  第5页  第6页  第7页  第8页  第9页  第10页 

……

相关阅读