Re: Opening URLs
| From: | Lee P. Reilly | Date: | Tue, 22 Apr 2003 14:25:33 +0000 |
| Subject: | Re: Opening URLs | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144826@lists.php.net to get a copy of this message | ||
Both fread() and fgets() return nothing. It's very strange - I can use any
other search engine URL (with search terms) and it works, but just not
Google! For the record, I'm running PHP 4.2.2.
Using a snippet from the PHP doc:
------------
$fp = @fopen("http://www.google.com/q=metallica","r");
if ($fp)
{ print"The file exists!"; }
else
{ print"The file does not exist"; }
------------
The output is, "The file does not exist"!
When I use Google itself as the URL:
------------
$fp = @fopen("http://www.google.com","r");
if ($fp)
{ print"The file exists!"; }
else
{ print"The file does not exist"; }
------------
The output is, "The file exists"!