<?php
 


//$url='https://www.google.com.hk';
//$url='https://www.facebook.com';
//$url='https://www.bing.com';  ,"fr"Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple, ';var ctr, h;tld='  TRANSLATED_TEXT='


$wf=file_get_contents_by_curl("<a href='https://www.baidu.com'>Hello there apple</a>,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,Hello there apple,");



echo $wf;

function file_get_contents_by_curl($str,$obj="zh-CN",$src="en"){
$str=rawurlencode($str);
//echo $str;exit;
$url='https://translate.google.cn/?sl='.$src.'&tl='.$obj.'&text='.$str.'#'.$src.'/'.$obj.'/'.$str.'';
@set_time_limit(0);
$html = "";
$ch = curl_init();
$user_agent = "Mozilla/4.0";
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_HEADER,0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);//禁止调用时就输出获取到的数据
curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 0);
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME);
curl_setopt($ch, CURLOPT_PROXY, "127.0.0.1");
curl_setopt($ch, CURLOPT_PROXYPORT, "25378");
$html = curl_exec($ch);
curl_close($ch);

//echo $html;
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]);
$x=explode("';var ctr, h;tld='",$html);
$x=explode("TRANSLATED_TEXT='",$x[0]);

return   ggdecode($x[1]);
}else{
return false;
}

  
}
 

function ggdecode($str){
    $str=str_replace("\\x26lt;","<",$str);
    $str=str_replace("\\x3d","=",$str);
    $str=str_replace("\\x26#39;","'",$str);
    $str=str_replace("\\x26gt;",">",$str);
    return$str;
}

/*$fh = fopen($url, 'r');

if($fh){

    while(!feof($fh)) {

        echo fgets($fh);

    }

}

 

*/

?>