Php 如何在Google translator API中增加翻译内容大小

Php 如何在Google translator API中增加翻译内容大小,php,google-translate,Php,Google Translate,我正在使用谷歌翻译API function curl($url,$params = array(),$is_coockie_set = false) { if(!$is_coockie_set){ /* STEP 1. let’s create a cookie file */ $ckfile = tempnam ("/tmp", "CURLCOOKIE"); /* STEP 2. visit the homepage to set the cookie properly */ $ch =

我正在使用谷歌翻译API

function curl($url,$params = array(),$is_coockie_set = false)
{

if(!$is_coockie_set){
/* STEP 1. let’s create a cookie file */
$ckfile = tempnam ("/tmp", "CURLCOOKIE");

/* STEP 2. visit the homepage to set the cookie properly */
$ch = curl_init ($url);
curl_setopt ($ch, CURLOPT_COOKIEJAR, $ckfile);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec ($ch);
}

$str = ''; $str_arr= array();
foreach($params as $key => $value)
{
$str_arr[] = urlencode($key)."=".urlencode($value);
}
if(!empty($str_arr))
$str = '?'.implode('&',$str_arr);

/* STEP 3. visit cookiepage.php */

$Url = $url.$str;

$ch = curl_init ($Url);
curl_setopt ($ch, CURLOPT_COOKIEFILE, $ckfile);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);

$output = curl_exec ($ch);
return $output;
}
在这个GoogleAPI中,仅翻译了500个字符

function Translate($word,$conversion)
{
$word = urlencode($word);
$url = 'http://translate.google.com/translate_a/t?client=t&text='.$word.'&hl=en&sl=en&tl=fr&ie=UTF-8&oe=UTF-8&multires=1&otf=1&ssel=3&tsel=3&sc=1';
}
这是用于翻译内容的函数。我想翻译500多个字符。 请告诉我。

见:

有免费配额吗? 不,Google Translate API仅作为付费服务提供。有关更多详细信息,请参阅定价和支持。然而,我们提供谷歌网站翻译小工具,它将免费翻译您的网站


你使用的是付费的API免费版本,因为你必须付费。-如果你付钱的话<代码>每个请求的最大字符数是多少?要翻译的每个文本的最大大小为5000个字符,不包括任何HTML标记。