file_get_contents 多参数

版权声明:原创文章转载请附带www.phpnote.net https://blog.csdn.net/koobee_1/article/details/41007583
//禁止缓存
header("Expires:Mon,26Jul199705:00:00GMT");
header("Pragma:no-cache");


//设置编码
header("Content-Type:text/html;charset=utf-8");


//获取远程文件内容
function readtemp($tempurl){
$opts=array('http'=>array('method'=>'GET','timeout'=>500));   
$context=stream_context_create($opts);  //创建输入流
@$temphtml=file_get_contents($tempurl,false,$context) or die("文件不存在:".$tempurl);
return $temphtml;
}
//输出内容
echo <span style="font-family: Arial, Helvetica, sans-serif;">readtemp('http://xxx.com');</span>

猜你喜欢

转载自blog.csdn.net/koobee_1/article/details/41007583