<?php
require_once 'curl.func.php';
$appkey = 'your_appkey_here';//你的appkey
$type = 'google';
$from = 'zh-CN';
$to = 'en';
$text = '好';//utf8
$arr=array('type'=>$type,'from'=>$from,'to'=>$to,'text'=>$text);
$url = "https://api.jisuapi.com/translate/translate?appkey=$appkey";
$result = curlOpen($url, array('post'=>$arr));
$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));
if($jsonarr['status'] != 0)
{
echo $jsonarr['msg'];
exit();
}
$result = $jsonarr['result'];
echo $result['result'].'
';