php的乱码问题 大家帮忙看看http://zhidao.baidu.com/question/110068264.html就是像C#的这种功能 PHP有没有? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 出现类似逆流 的东西 我想把它转换成汉字然后入库 有办法吗? function translate($text,$language='ru|zh-cn'){ if(empty($text))return false; @set_time_limit(0); $html = ""; $ch=curl_init("http://google.com/translate_t?langpair=".urlencode($language)."&text=".urlencode($text)); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_HEADER,0); curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1); $html=curl_exec($ch); if(curl_errno($ch))$html = ""; curl_close($ch); if(!empty($html)){ $x=explode("</span></span></div></div>",$html); $x=explode("onmouseout=\"this.style.backgroundColor='#fff'\">",$x[0]); return $x[1]; }else{ return false; }}$conn=mysql_connect('localhost','root','root');mysql_select_db(demo,$conn);mysql_query("set names 'utf8'");echo translate('противоточная');$sql="INSERT INTO art(title,cont) VALUES ('我已经','$xxx')";mysql_query($sql); 求学习php将百度与谷歌的搜索结果对比显示代码(如网址) 加个confirm(),就是确定后再操作 如何将JS变量赋值给PHP变量 php update失败 用的mysql数据库 北京PHP面试 linux 郵件發送 各位大大,来帮我分析一下,一起进步嘛 mysql_connect()函数出错 php5.0.4不能加载mysql4.1.7 有何模板有smarty那样强大的缓存功能? 网站制作入门,求高手给制定学习计划,用什么语言编,看什么书 论坛迁移后flock阻塞的问题
function translate($text,$language='ru|zh-cn'){
if(empty($text))return false;
@set_time_limit(0);
$html = "";
$ch=curl_init("http://google.com/translate_t?langpair=".urlencode($language)."&text=".urlencode($text));
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_HEADER,0);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
$html=curl_exec($ch);
if(curl_errno($ch))$html = "";
curl_close($ch);
if(!empty($html)){
$x=explode("</span></span></div></div>",$html);
$x=explode("onmouseout=\"this.style.backgroundColor='#fff'\">",$x[0]);
return $x[1];
}else{
return false;
}
}
$conn=mysql_connect('localhost','root','root');
mysql_select_db(demo,$conn);
mysql_query("set names 'utf8'");
echo translate('противоточная');
$sql="INSERT INTO art(title,cont) VALUES ('我已经','$xxx')";
mysql_query($sql);