PHP读取网页文件内容的实现代码(fopen,curl等)

时间:2020-12-19 04:39:06
【文件属性】:
文件名称:PHP读取网页文件内容的实现代码(fopen,curl等)
文件大小:33KB
文件格式:PDF
更新时间:2020-12-19 04:39:06
c cu curl 1.fopen实现代码:复制代码 代码如下: <?php $handle = fopen (“http://www.example.com/”, “rb”); $contents = “”; while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle); ?> 复制代码 代码如下: <?php // 对 PHP 5 及更高版本 $handle = fopen(“http://www.example.com/”, “rb”); $contents = stream_get_contents($hand

网友评论