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
Post a Comment