Failsafe looping trough array of urls
<p>How can I loop trought an array of external websites and not fail catastrophically if one of the websites doesn't respond? Consider the following psuedo code:</p>

<pre><code>$urls = array(list of urls);
foreach ($urls as $url) {
 try {
      $page = get_page($url);
      $title = $page['title'];
 catch(Exception $e) {
      continue;
 }
 }
</code></pre>

<p>What i want to happen is to try and load page, if it doesn't respond then skip to the next url in the list. The problem is $title is set to blank. I tried grouping the code in a function but I still can't get the error exception to skip whole blocks of code.</p>
