title: Make a PHP GET request from a PHP script and exit
body: <p>Is there something simpler than the following.</p>
  
  <p>I am trying to make a GET request to a PHP script and then exit the current script. </p>
  
  <p>I think this is a job for CURL but is there something simpler as I don't want to really worry about enabling the CURL php extension?</p>
  
  <p>In addition, will the below start the PHP script and then just come back and not wait for it to finish?</p>
  
  <pre><code>//set GET variables
  $url = 'http://domain.com/get-post.php';
  
  $fields = array(
      'lname'=&gt;urlencode($last_name),
      'fname'=&gt;urlencode($first_name)
      );
  
  //url-ify the data for the GET
  foreach($fields as $key=&gt;$value) { $fields_string .= $key.'='.$value.'&amp;'; }
  rtrim($fields_string,'&amp;');
  
  //open connection
  $ch = curl_init();
  
  //set the url, number of POST vars, POST data
  curl_setopt($ch,CURLOPT_URL,$url);
  curl_setopt($ch,CURLOPT_GET,count($fields));
  curl_setopt($ch,CURLOPT_GETFIELDS,$fields_string);
  
  //execute GET
  $result = curl_exec($ch);
  
  //close connection
  curl_close($ch);
  </code></pre>
  
  <p>I want to run the other script which contains functions when a condition is met so a simple include won't work as the if condition wraps around the functions, right?</p>
  
  <p>Please note, I am on windows machine and the code I am writing will only be used on a Windows OS.</p>
  
  <p>Thanks all for any help and advice</p>