PHP抓取网页内容汇总.docVIP

  • 2
  • 0
  • 约3.64千字
  • 约 5页
  • 2019-10-10 发布于江西
  • 举报
PHP抓取网页内容汇总 /quqiufeng/blog/item/7e86fb3f40b598c67d1e7150.html header(Content-type: text/html; charset=utf-8); 1、 $xhr = new COM(MSXML2.XMLHTTP); $xhr-open(GET,http://localhost/xxx.php?id=2,false); $xhr-send(); echo $xhr-responseText 2、file_get_contents实现 ?php $url=/pts; echo file_get_contents( $url ); ? 3、fopen()实现 ? if ($stream = fopen(, r)) { // print all the page starting at the offset 10 echo stream_get_contents($stream, -1, 10); fclose($stream); } if ($stream = fopen(, r)) { // print the first 5 bytes echo stream_get_contents($stream, 5); fclose($stream); } ? ②、使用

文档评论(0)

1亿VIP精品文档

相关文档