<pre name="code" class="php">php: <?php //Using baidu translate API $content=urlencode($_GET["cont"]); //$content="nihao"; $api="your apikeys"; $url="https://openapi.baidu.com/public/2.0/bmt/translate?client_id=$api&q=$content&from=auto&to=auto"; $str=file_get_contents($url); $tmp=json_decode($str); $con=$tmp->trans_result;//注意api返回的是对象 UI用我之前的ajax框架便可 echo $con[0]->dst; ?><pre name="code" class="php">php: <?php //Using ba