×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Иван Цыганков
Added: Nov 10, 2017 4:53 AM
Views: 5
Tags: curl ssl
  1. function getSslPage($url) {
  2.     $ch = curl_init();
  3.     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  4.     curl_setopt($ch, CURLOPT_HEADER, false);
  5.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  6.     curl_setopt($ch, CURLOPT_URL, $url);
  7.     curl_setopt($ch, CURLOPT_REFERER, $url);
  8.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  9.     $result = curl_exec($ch);
  10.     curl_close($ch);
  11.    
  12.     return $result;
  13. }