function php translateText
<?php@php88
function translateText($text, $targetLanguage) {
$url = 'https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=' . $targetLanguage . '&dt=t&ie=UTF-8&oe=UTF-8&otf=1&ssel=0&tsel=0&kc=7&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&q=' . urlencode($text);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$json = json_decode($response, true);
$translatedText = $json[0][0][0];
return $translatedText;
}
?>
@mroan8
>>Click here to continue<<