Posted by Sadie on 06/25/07 07:58
Hi,
I am trying to read in a url which is encoded in GB2312 (http://
top.baidu.com/winkvane.html). I have tried other pages with this
encoding and each time I get a connection time out error. It seems
that fopen cannot open a webpage in GB2312. Is there a way around
this? Has anyone else had this sort of problem?
Here is an example with some simple code (using PHP5):
$file = fopen("http://top.baidu.com/winkvane.html", "r") or
exit("Unable to open file!");
while(!feof($file))
{
echo fgets($file). "<br />";
}
fclose($file);
Any ideas would be greatly appreciated! Thank you.
Sadie
[Back to original message]
|