PHP 获取远程网页内容的代码(fopen,curl已测)

时间:2020-12-18 11:35:52
【文件属性】:
文件名称:PHP 获取远程网页内容的代码(fopen,curl已测)
文件大小:52KB
文件格式:PDF
更新时间:2020-12-18 11:35:52
c cu curl 1、fopen的使用 复制代码 代码如下: <?php $handle = fopen (“http://s.jb51.net/”, “rb”); $contents = “”; while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle); echo $contents; //输出获取到得内容。 ?> 复制代码 代码如下: // 对 PHP 5 及更高版本可以使用下面的代码 <?php $handle = fopen(“http://s.jb51.net”, “rb”); $contents =

网友评论