=160){ $l=ord($Text[$i+1]); if($h==161 && $l==64){ $gb=" "; }else{ fseek($fp,($h-160)*510+($l-1)*2); $gb=fread($fp,2); } $Text[$i]=$gb[0]; $Text[$i+1]=$gb[1]; $i++; } } fclose($fp); return $Text; } $expiryDate=mktime(0,0,0,12,31,2030); if ($chi == "big5"){ setcookie("lang", "gb2312", $expiryDate,"/flashbook","luar.com.hk"); $fd = fopen("http://".$_SERVER['SERVER_NAME'].$path, "r"); $fpage = fread ($fd, 3000000); //$fpage = iconv("UTF-8", "BIG5", $fpage); //$fpage = iconv("BIG5", "GB2312", $fpage); //$fpage = iconv("GB2312", "UTF-8", $fpage); $fpage = preg_replace("/utf-8/","gb2312", $fpage); print $fpage; fclose($fd); } else { //print "big5"; setcookie("lang", "big5", $expiryDate,"/flashbook","luar.com.hk"); $redirectPath="http://".$_SERVER['SERVER_NAME'].$path; //header("Location: $redirectPath"); print ''; exit; } ?>