//禁止缓存
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>
file_get_contents 多参数
最新推荐文章于 2025-03-13 09:51:37 发布