摘要:
php fsockopenwget方法在采集机器人功能中由于服务器不支持allow_url_fopen导至file_get_contents()和file()两个函数都不能获取远程URL的内容。方法1: 用file_get_contents 以get方式获取内容<?php$url='http://www.domain.com/';$html = file_get_contents($url);echo $html;?>方法2: 用fopen打开url, 以get方式获取内容<?php$fp = fopen($url, 'r');stream_g 阅读全文
posted @ 2013-05-09 16:19
hechunhua
阅读(277)
评论(0)
推荐(0)
摘要:
<?php function runThread() { $fp = fsockopen('localhost', 80, $errno, $errmsg); fputs($fp, "GET /test/doublethread.php?act=b\r\n\r\n"); //这里的第二个参数是HTTP协议中规定的请求头 //不明白的请看RFC中的定义 fclose($fp); } function a() { $fp = fopen(... 阅读全文
posted @ 2013-05-09 15:52
hechunhua
阅读(173)
评论(0)
推荐(0)

浙公网安备 33010602011771号