title: How can I test for the detected language via Bing's Translation API to be equal to "EN"?
body: <pre><code>$language = file_get_contents('http://api.microsofttranslator.com/V2/Ajax.svc/Detect?appid=APPID&amp;text=hello');
  
  $language = str_replace('"', '', $language);
  
  if($language != 'en')
  {
      echo 'not english';
  }
  {
      echo 'english';
  }
  </code></pre>
  
  <p>So, what happens in the code above is <code>file_get_contents</code> will output <code>"en"</code>, I then remove the quotation marks and compare if it is equal to <code>en</code>. But the problem with the code above is that it will output <code>not english</code> even though <code>'en' != 'en'</code>.</p>
  
  <p>Any idea what I could be doing wrong? I also tried to convert <code>$language</code> to a string <code>(string)$language</code>, but that didn't fix it either.</p>