将变量$this换名,比如$the。即
$the = substr($gb,0,2);
$gb = substr($gb, 2, strlen($gb));
$utf8 = u2utf8(hexdec($codetable[hexdec(bin2hex($the))-0x8080]));在php4中当$this出现在类定义之外时,$this当作普通变量解释。
而在php5中$this只能出现在类定义之中你的这个代码是在php4中使用的,php5已经内置了iconv函数组,不再需要自己用编码对照表进行编码转换了
$the = substr($gb,0,2);
$gb = substr($gb, 2, strlen($gb));
$utf8 = u2utf8(hexdec($codetable[hexdec(bin2hex($the))-0x8080]));在php4中当$this出现在类定义之外时,$this当作普通变量解释。
而在php5中$this只能出现在类定义之中你的这个代码是在php4中使用的,php5已经内置了iconv函数组,不再需要自己用编码对照表进行编码转换了
转换就可以了