title: Making http request from PHP file with JSON response
body: <p>I am in the process of trying to call a php script over http and receive a json object back from where I plan to process further.</p>
  
  <p>Basically, the code is as follows:</p>
  
  <pre><code>&lt;?php
      if ($_SERVER['REQUEST_METHOD'] === 'GET') {
          $version=$_GET["v"];
          $product=$_GET["p"];
          $stream=$_GET["s"];
          $cmd=$_GET["c"];
  
          $string = file_get_contents("http://localhost:82/releasenote/src/getTSBDetails.php?p=$product&amp;v=$version&amp;s=$stream&amp;c=$cmd");
          print_r($string);
          exit();
      } else {
          print("2");
          $string = file_get_contents('tsbDetails.json');
      }
  </code></pre>
  
  <p>When the get_file_contents http request is called directly in the browser, the output is a json, but when trying using the above there is no response.</p>