Hi,
Is there a way i can change the spanish word which i have typed in the textbox to its english word in php.
Is there any way to do this in php.
Please help me
Thanks
Hi,
Is there a way i can change the spanish word which i have typed in the textbox to its english word in php.
Is there any way to do this in php.
Please help me
Thanks
You can use the Google AJAX Language API to do conversion. For example:
google.language.translate("Hello world", "en", "es", function(result) { if (!result.error) { var container = document.getElementById("translation"); container.innerHTML = result.translation; } });
that's Javascript. There is a PHP port.
<?php /** * example usage */ // we need the page treated as utf-8, otherwise the encoding will be mangled header('Content-Type: text/html; charset=utf-8'); // require google language api class require_once('google.translator.php'); // translate text $text = 'Welcome to my website.'; $trans_text = Google_Translate_API::translate($text, 'en', 'it'); if ($trans_text !== false) { echo $trans_text; } ?>