detection - What is the easiest way to use Google AJAX Language API to detect language with PHP? -


Using the Google AJAX Language API to detect language with PHP without using any library or a large framework An easy way to do?

It is easy,

  function detect_language ($ string) { $ Response = file_get_contents ("http://www.google.com/uds/GlangDetect?v=1.0&q=". Urlencode ($ string)); $ Response = json_decode ($ response, true); If ($ reaction ['rectitude'] == 200) {returns $ response ['responseData'] ['language']; } And {return "tw"; }}  

Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -