First Type:
Use functions directly:
File_get_contents ();
The prerequisite is that PHP compile time to support SSL, that is, add the WITH=OPENSSL option, Windows will need to open the Extention=openssl.dll option.
For example: Echo file_get_contents (' https://www.paypal.com/c2 '), you can print out the results.
The second type:
Using curl, of course your PHP needs to support Curl,linux in need of configuration ... , Windows requires configuration .... Omitted
Method:
Ob_start ();
$url = (' https://www.paypal.com/c2 ');
$ch = Curl_init ();
curl_setopt ($ch, Curlopt_url, $url);
curl_setopt ($ch, Curlopt_ssl_verifypeer, false);
curl_setopt ($ch, Curlopt_ssl_verifyhost, false);
$result = curl_exec ($ch);
$r = Ob_get_contents ();
Echo $r;
The principle is to print the content to a buffer and then assign the buffer contents to a variable.
Resources:
PHP supports Curl extensions:
Http://developer.51cto.com/art/200904/121739.htm
http://php.net/manual/en/function.file-get-contents.php