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

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -