title: PHP If file_get_contents fails, do this instead
body: <p>I have a function to translate the current text string using the Free Bing translator API.  I just want to make sure if anything fails or something happens with the Application ID or I go over on requests, I don't want a big error to show.</p>
  
  <p>The code I have right now is:</p>
  
  <pre><code>$translate_feed = file_get_contents('http://api.microsofttranslator.com/v2/Http.svc/Translate?appId=' . BING_APPID . '&amp;text=' . urlencode($text) . '&amp;from=en&amp;to=' . $to_lan . '');
  $translate = simplexml_load_string($translate_feed);
  
  return $translate[0];
  </code></pre>
  
  <p>What I want to happen is if anything fails, so if I add in another character to the URL to make it invalid then I want it to just return <code>$text</code> so at least <em>something</em> shows.</p>
  
  <p>Thanks!</p>