title: stop running php function if exceed a given time
body: <p>I need to parse many html files using php.</p>
  
  <pre><code>foreach($url_array as $url){
  
       $file = file_get_contents($url);
  
       parse_html($file);
  
  }
  </code></pre>
  
  <p>For some reasons (file is too big), function parse_html() take very long time to run or has memory leak in it.</p>
  
  <p><strong>I want to monitor function parse_html(). If the running time exceed a given time, should continue to parse the next url and disregard the current one.</strong></p>
  
  <p>For most of the time, my codes runs great but there are some urls can not be parsed. There is no error output and I guess it is memory leak. </p>