title: Making a GET request to another PHP file in PHP
body: <p>I have created a php file called "brain.php" that takes a get parameter of "message" - so for example "brain.php?msg=hello". It will respond with a JSON array that can be handled by the application.</p>
  
  <p>I have built a JQuery app that can make these requests, and now I'm attempting to do it in PHP but I'm not sure how. </p>
  
  <p>The following code does not work as it thinks the parameter is part of the filename</p>
  
  <pre><code>$response = file_get_contents("../brain.php?msg=hello");
  echo $response;
  </code></pre>
  
  <p>The following code kind of works but simply responds with the entirety of the code instead of the response</p>
  
  <pre><code>$response = file_get_contents("../brain.php");
  echo $response;
  </code></pre>
  
  <p>What is the best way to make the request with the ?msg variable and store the JSON response in a variable for handling?</p>
  
  <p>Thank you!</p>