最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php file_get_contents函数
时间:2022-07-02 10:04:16 编辑:袖梨 来源:一聚教程网
php file_get_contents函数,
本函数用来读取远程服务器文件的内容,这样大大的方便写采集朋友了,只要很简单的一句就可以把远程服务器的文件保存到自己的数据库,你说简单不,光说不行了我举个例子看看吧.
function getcontent($url) {
$retmsg =file_get_contents(' http://111com.net/index.html ');
return $retmsg;
}
这就么一句,你想要的远程内容就给你偷过来了,不过还有一个与file_get_contents函数相同的ob_get_contents();函数,但听说效果要好了一些.
/*
$ch =curl_init($url);
ob_start();
curl_exec ($ch);
$retmsg=ob_get_contents();
ob_clean();
ob_end_flush();
curl_close ($ch);
*/
呵呵,具体那个好你自己用了才知道了我就说到这里了,本站原创转载请注明: www.111com.net
相关文章
- 《夜族崛起》铁匠西里尔位置一览 05-17
- 《寓言之地》1.02更新内容一览 05-17
- 《辐射4》steam好评率介绍 05-17
- 《夜族崛起》技能强化珠宝掉落说明 05-17
- 《辐射4》主机控制台介绍 05-17
- 《星露谷物语》海草和绿藻获取方法 05-17