我想开发一个模块。用户可以在其中键入问题,问题将显示在古吉拉特语&它必须存储在数据库中。所以我可以用古吉拉特语看这个问题。所有这些我都想在php &mysql。所以请帮助我关于相同的…由于
您可以使用Google Translate API进行转换,然后可以将转换后的文本存储到您的数据库中。
<?php
$apiKey = '<paste your API key here>';
$url = 'https://www.googleapis.com/language/translate/v2/languages?key=' . $apiKey;
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); //We want the result to be saved into variable, not printed out
$response = curl_exec($handle);
curl_close($handle);
print_r(json_decode($response, true));
?>