title: PHP data fetch script working in localhost but not working in hosting with ssl
body: <p>i want to fetch data from user input url. i tried in localhost it is working but when uploaded to hosting it is not working.
  Please help regarding this.</p>
  <pre><code>function file_get_contents_curl($url) {
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
  //browser's user agent string (UA) 
  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.47 Safari/537.36');
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); 
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);    
  $data = curl_exec($ch);
  curl_close($ch);
  return $data;}
  //Checking for the json data in fetched content
  $pattern = '/window._sharedData = (.*) /';
  preg_match($pattern, $data, $matches);
  
  //checking if we got the data or not
  if(!$matches){
  $response['status'] = 'fail';   
  echo json_encode($response);
  exit; }
  //getting json from content
  $json = $matches[1];
  //decoding json to process
  $data = json_decode($json, true);
  </code></pre>