用fopen 会出错.$str=fopen("http://www.phpchina.com/index.php","r"); 出错如下 Warning: fopen() [function.fopen]: php_network_getaddresses: getaddrinfo failed: ??֪??⑹?Ė?? in E:\AppServ\www\b\index.php on line 67Warning: fopen(http://www.phpchina.com/index.php) [function.fopen]: failed to open stream: No error in E:\AppServ\www\b\index.php on line 67file_get_contents 这个也不行。出的错和上面差不多。
echo file_get_contents('http://www.baidu.com');
出错如下
Warning: fopen() [function.fopen]: php_network_getaddresses: getaddrinfo failed: ??֪??⑹?Ė?? in E:\AppServ\www\b\index.php on line 67Warning: fopen(http://www.phpchina.com/index.php) [function.fopen]: failed to open stream: No error in E:\AppServ\www\b\index.php on line 67file_get_contents 这个也不行。出的错和上面差不多。
因为192.168.2.200/后面的index.php是真实的,所以就不出错了。