Re: curl equivalent in PHP
| From: | Micky Hulse | Date: | Fri, 02 Mar 2012 16:39:49 +0000 |
| Subject: | Re: curl equivalent in PHP | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-316845@lists.php.net to get a copy of this message | ||
Hello,
On Fri, Mar 2, 2012 at 8:07 AM, Jim Lucas <lists@cmsws.com> wrote:
>> But on some of my servers, curl isn't enabled! Is there any equivalent
>> code
>> to achieve the same?
I've used a combination of output buffering [1], readfile() [2] and
caching (specific to the framework I was using).
Simply, you could resort to:
<?php readfile('http://www.google.com');
?>
Ofc, the links would need to be absolute in order for the assets to load.
Good luck!
Cheers,
Micky
[1] php.net/ob-start
[2] php.net/readfile