//http://code.google.com/intl/pl/apis/language/translate/v1/using_rest_translate.html#json_snippets_php 'hello', 'world', 'i', 'need', 'to', 'figure', 'out', 'how', 'to', 'translate', 'faster', 'using', 'google', 'translate'); $ch = curl_init(); for($i = 0, $k = 0; $k < 14; $i++, $k++) { $url = "https://ajax.googleapis.com/ajax/services/language/translate". "?v=1.0&q=$words[$i]&langpair=en%7Cpl"; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $body = curl_exec($ch); $json = json_decode($body); } curl_close($ch);
Powyżej pewnej liczby strasznie zamula. Do kilkunastu słówek na każde zabiera np. ~ 0.05s. Czasem nawet 10 dłużej na każdym słowie + w niektórych nie tłumaczy. Ograniczenie Google?