Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
$text = "текст поста";
$url = "хттп://translate.google.com/translate_t";
$useragent="Opera/9.22 (Windows NT 5.1; U; ru)";
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 4);
$text=urlencode($text);
$postdata="hl=en&ie=UTF8&langpair=ru|en&text=".$text;
curl_setopt($ch, CURLOPT_POSTFIELDS,$postdata);
$result= curl_exec ($ch);
curl_close ($ch);
$dela=strpos($result,"<div id=result_box dir=ltr>");
$panala=strpos($result,"</",$dela);
$text=substr($result,$dela+27,$panala-$dela-27);
$text=str_replace("'","'",$text);
$text=str_replace("&","&",$text);
Попробуй с помощью Google Translator переписать базу
[
А как сделать так?
У меня есть тескст в mysql базе такого вида:
id1 Title
id2 content (то есть текст)
Надо чтобы шел запрос на хттр://translate.google.com/translate_t брал id1, id2 и сохранял под другим параметром в mysql базе и в другом языке на выбор, то есть en, ru, и т.п.
Заранее спасибо.