d
Amit DhamuSoftware Engineer
 

cURL

1 minute read 00000 views
function Curl($url) {
    $c = curl_init();
    $timeout = 5;
    curl_setopt($c, CURLOPT_URL, $url);
    curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($c, CURLOPT_CONNECTTIMEOUT, $timeout);
    $data = curl_exec($c);
    curl_close($c);

    return $data;
}

$curl_result = Curl('feed.xml'); // Remember to use absolute path for real implementation