PHP: Limit execution time per function
<pre><code>foreach ($arr as $k =&gt; $v)
{
    $r = my_func($v);   

    $new[$k] = $r;
}
</code></pre>

<p>How do you do it so that <code>$r</code> will return false if <code>my_func()</code> takes more than 10 secs to execute, else (if it took less than 10 secs) it will return true;</p>

<p>Additional info: <code>my_func()</code> actually reads a URL, sometimes it takes to long. I want it to return false if it takes more than 10 secs.</p>
