PHP Stop script file_get_contents() after 2 seconds
<p>Okay so I have a PHP script that loads another page using <code>file_get_contents()</code>.</p>

<p>The other page takes around 30 seconds to load (the type of script it is), and all I need is the <code>file_get_contents()</code> is to initiate this script.</p>

<p>The problem is, the <code>file_get_contents()</code> will stay loading for the whole 30 seconds. The only way to stop this is to close the tab (when closing the tab the script it calls still runs).</p>

<p>So, how can I get it so the <code>file_get_contents();</code> closes after say 2 seconds?</p>

<p>Thanks in advance</p>
