note 95923 added to function.file-get-contents
| From: | magnets at osu1 dot php dot net | Date: | Thu, 28 Jan 2010 23:39:18 +0000 |
| Subject: | note 95923 added to function.file-get-contents | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-165470@lists.php.net to get a copy of this message | ||
Occasionally file_get_contents is unable to retrieve a web page. The quickest method I have
discovered to retrieve the same string is to use WGET to retrieve and store the file and then use
file_get_contents to retrieve that stored file.
$input = file_get_contents($url);
if(!$input) {
exec 'wget $url -O ' . $filename;
$input = file_get_contents($filename);
}
----
Server IP: 64.71.164.2
Probable Submitter: 24.98.86.25
----
Manual Page -- http://www.php.net/manual/en/function.file-get-contents.php
Edit -- https://master.php.net/note/edit/95923
Del: integrated -- https://master.php.net/note/delete/95923/integrated
Del: useless -- https://master.php.net/note/delete/95923/useless
Del: bad code -- https://master.php.net/note/delete/95923/bad+code
Del: spam -- https://master.php.net/note/delete/95923/spam
Del: non-english -- https://master.php.net/note/delete/95923/non-english
Del: in docs -- https://master.php.net/note/delete/95923/in+docs
Del: other reasons-- https://master.php.net/note/delete/95923
Reject -- https://master.php.net/note/reject/95923
Search -- https://master.php.net/manage/user-notes.php