title: CURL with port and additional parameters in URL, JSON parsing
body: <p>I have a URL in the form of <code>http://www.domain.com:10001/api/Data.cgi?Scope=System</code></p>
  
  <p>On that URL is a JSON dump which I need to parse. How do I access it? I've used <code>get_file_contents</code> before which is why I am struggling with this - first occasion to have a port on the URL. It would be best if I could grab the JSON and put it in a file.txt and then parse the file.</p>
  
  <pre><code>&lt;?php
  $cURL = curl_init('http://81.1.1.1'); 
  curl_setopt($cURL, CURLOPT_PORT, 10001); 
  curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true); 
  
  $fp = fopen("example_homepage.txt", "w");
  curl_setopt($cURL, CURLOPT_FILE, $fp);
  curl_setopt($cURL, CURLOPT_HEADER, 0);
  curl_exec($cURL);
  curl_close($cURL);
  fclose($fp);
  ?&gt;
  </code></pre>
  
  <p>I'm not sure how to properly add the remainder of the URL.</p>