function curl_get_url_contents($url)
{
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
$content = curl_exec($curl);
curl_close($curl);
return $content;
}
echo curl_get_url_contents("https://www.example.com/");
/*
run:
<!doctype html>
<html>
<head>
<title>Example Domain</title>
...
*/