调用Google翻译的接口,需要开启curl支持。
google在线翻译插件,php在线翻译插件
我已经将些做成一个页面
http://translate.adophper.com/
[php]
<?php
/*
Google翻译函数 by QQ366958903
$text 要翻译的文本
$tl 目标语言
$sl 原语言
$ie 字符编码
*/
function translate($text='',$tl='zh-CN',$sl='auto',$ie='UTF-8'){
$ch = curl_init('http://translate.google.cn/');
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch...