title: cURL results in NULL although JSON is valid
body: <p>I'm curling a url that drops a json result. The result of the curl is always NULL though.</p>
  
  <p>main.php  </p>
  
  <pre><code>function getUserSettings(){
  ...
  $json = json_encode($userSettings);
  header('Content-Type: application/json');
  return $json;
  }
  </code></pre>
  
  <p>getusersettings.php  </p>
  
  <pre><code>...
  $api-&gt;uid = isset($_SESSION['uid']) ? $_SESSION['uid'] : die();
  
  $result = $api-&gt;getUserSettings();
  echo $result;
  ...
  </code></pre>
  
  <p>settings.php</p>
  
  <pre><code>&lt;?php
  session_start();
  
  if(isset($_SESSION['uid'])) {
      //get the user settings
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($ch, CURLOPT_HEADER, false);
      curl_setopt($ch, CURLOPT_URL, 'https://www.url.com/api/getstgs');
      $result = curl_exec($ch);
      curl_close($ch);
  
      $obj = json_decode($result, true);
      print_r($obj);die();
  }
  ...
  generate html
  ...
  ?&gt;
  </code></pre>
  
  <p>The json looks like this:</p>
  
  <blockquote>
    <p>{"lcns":[{"product_name":"Addon: Addonname","license_key_decrypted":"XXXXXXXXXXXXXX","expires_at":"0000-00-00 00:00:00"}],"stgs":[{"Type":"1","Amount":"0"}]}</p>
  </blockquote>