Jump to content

curl webpage into string variable help


MDanz

Recommended Posts

i'm trying this below but it isn't working, the page is coming up blank.

 

<?php
$url = 'http://www.realgm.com';
function get_url_contents($url){
        $crl = curl_init();
        $timeout = 5;
        curl_setopt ($crl, CURLOPT_URL,$url);
        curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
        $ret = curl_exec($crl);
        curl_close($crl);
        return $ret;
}

?>

Link to comment
https://forums.phpfreaks.com/topic/196024-curl-webpage-into-string-variable-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.