比较常用的有:
curl
file_get_contentfopen
<?php// Create a stream$opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en\r\n" . "Cookie: foo=bar\r\n" ));$context = stream_context_create($opts);// Open the file using the HTTP headers set above$file = file_get_contents('replace it as a url', false, $context);?>
本文介绍使用PHP发起网络请求的方法,包括如何设置HTTP头部信息、创建流上下文及使用file_get_contents函数获取网页内容。
592

被折叠的 条评论
为什么被折叠?



