大家帮忙看看http://zhidao.baidu.com/question/110068264.html
就是像C#的这种功能   PHP有没有?

解决方案 »

  1.   

    出现类似逆流   的东西  我想把它转换成汉字然后入库   有办法吗?
      

  2.   


    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);