title: Return value from include on a remote file
body: <p>I am trying to run a script on a remote server, and have the results of that script returned to the calling script. A variable is sent to the remote script, and based on that the remote script is meant to retrieve a list of filenames on the remote server, and return those filenames as an array. However, using return in the included file is not returning an actual value, it just aborts the script. Other than that, the remote script runs without a problem, and I can have it var_dump the list of filenames for me, but that doesn't do much good for me on the local script. Both servers are owned by us (us being my company).</p>
  
  <p>I've tried something simple like this just to see if I could get a return value and it didn't work:  </p>
  
  <p>Local Script:  </p>
  
  <pre><code>$test = include "http://remote_host_address/remote_script.php";  
  var_dump($test);  
  </code></pre>
  
  <p>Remote Script:</p>
  
  <pre><code>$ret = "Hello World";
  return $ret;
  </code></pre>
  
  <p>This outputs <code>int(1)</code>. The code itself of the remote script works perfectly, that I've tested, and the variable I send as a get variable also goes through no problem. The only problem is that I am not getting a return value from the remote_script.</p>
  
  <p>Also, yes <code>allow_url_include</code> is on for the local server. However, it is off for the remote server; but that should not make a difference: <a href="http://php.net/allow-url-include" rel="nofollow">http://php.net/allow-url-include</a>.</p>
  
  <p>I have looked over some of the other related questions on this topic, and nothing seems to quite describe my problem. Any help would be greatly appreciated, as I have spent a few hours looking this over already and have not made any progress.</p>