php curl、fopen、file_get_contents实例代码
发布:smiling 来源: PHP粉丝网 添加日期:2014-08-17 20:45:41 浏览: 评论:
-
-
- session_write_close();
- $pageurl = "http://www.phpfensi.com/index.html";
- curl_setopt($ch, curlopt_returntransfer, 1);
- curl_setopt ($ch, curlopt_url, $pageurl );
- $html = curl_exec ( $ch );
- curl_close($ch);
-
- $search = "/(src|href|background)="[^:,^>,^"]*"/i";
- preg_match_all ( $search, $html, $a_matches );
-
-
-
- $file = fopen("http://www.phpfensi.com/","r"); //读取远程文件
- $file = fopen("a.txt","r");
-
- $homepage = file_get_contents('http://www.phpfensi.com/'); //读取远程文本
- echo $homepage;
- :
-
- $file = file_get_contents('./people.txt', true);
-
- $file = file_get_contents('./people.txt', file_use_include_path);
分享到: