php-i18n Digest 9 Nov 2007 17:31:01 -0000 Issue 371
Topics (messages 1127 through 1127):
Re: Open URL with UTF8 name
1127 by: Isaak Malik
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Luyen Tran schreef:
Hi,
I try to use PHP fopen to open the URL like the
following
http://dir.gigablast.com/World/Català/Economia_i_empresa/Serveis/Arts_i_entreteniment.
What i got is the error Could not open the file.
Here is the code
$filename =
"http://dir.gigablast.com/World/Català/Economia_i_empresa/Serveis/Arts_i_entreteniment";
fopen($filename, "r") || die ("Could not open file");
However, using IE to browse to this page is
successful.
Could anyone help me with that.
Thank alot,
Luyen Tran
Dear Luyen Tran,
I've just had a test and it works perfectly for me.
This is my code:
<?php
$file =
'http://dir.gigablast.com/World/Catal%C3%A0/Economia_i_empresa/Serveis/Arts_i_entreteniment';
$r = fopen($file, 'r') or die('Cannot open file!');
$read = fread($r, 1024);
fclose($r);
print $read;
?>
Make sure that your webhost allows remote fopen connections or if it
allows the fopen function at all.
Hope this helped.
~ Isaak Malik
--- End Message ---