1. 首页
  2. 数据库
  3. 其它
  4. PHP下通过file_get_contents的代理使用方法

PHP下通过file_get_contents的代理使用方法

上传者: 2020-12-23 01:26:48上传 PDF文件 49KB 热度 9次
PHP使用file_get_contents的代理方法获取远程网页的代码。 复制代码 代码如下: <?php $url = “https://www.jb51.net/”; $ctx = stream_context_create(array( ‘http’ => array(‘timeout’ => 5, ‘proxy’ => ‘tcp://60.175.203.243:8080’, ‘request_fulluri’ => True,) ) ); $result = file_get_contents($url, False, $ctx); echo $result;
下载地址
用户评论