最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php curl、fopen、file_get_contents实例代码
时间:2010-06-18 编辑:简简单单 来源:一聚教程网
//php教程 curl实例
代码如下 | 复制代码 |
session_write_close(); $pageurl = "http://www.111com.net/index.html"; //then you need to fix pathing to absolute preg_match_all ( $search, $html, $a_matches ); |
//php fopen实例
代码如下 | 复制代码 |
$file = fopen("http://www.111com.net/","r"); //读取远程文件 $file = fopen("a.txt","r");//读取本地文件 |
//php file_get_contents
$homepage = file_get_contents('http://www.111com.net/'); //读取远程文本
echo $homepage;
代码如下 | 复制代码 |
// <= php 5 $file = file_get_contents('./people.txt', true); // > php 5 $file = file_get_contents('./people.txt', file_use_include_path); //打开本地文本 |
-
上一个: PHP文件上传带进度条
相关文章
- PHP导出数据超时的优化建议解读 10-31
- PHP之mysql位运算解析 10-31
- Laravel实现登录跳转功能解析 10-31
- php双向队列解读 10-31
- Laravel异常上下文解决教程 10-24
- php数组查询元素位置方法介绍 10-24