这里的URL是一个脚本进行任何错误错误检查和开放使用PHP
$url="http://yahoo.com";
$file1 = fopen($url, "r");
$content = file_get_contents($url);
$t_beg = explode('<title>',$content);
$t_end = explode('</title>',$t_beg[1]);
echo $t_end[0];
,这里是用外观相同的脚本来检查多个网址,并收到错误
for ($j=1;$j<=$i;$j++) {
if ($x[$j]!=''){
$t_u = "http:".$x[$j];
$file2 = fopen($t_u, "r");
$content2 = file_get_contents($t_u);
$t_beg = explode('<title>',$content);
$t_end = explode('</title>',$t_beg[1]);
echo $t_end[0];
}
}
的误差为警告:fopen()函数[function.fopen]:php_network_getaddresses:的getaddrinfo失败:没有主机是已知的。在G:/
究竟什么是错在这里?
取决于 - 你检查什么网址?另外我注意到,你添加到http:而不是http:// - 是故意的,你存储//flibble.com而不是flibble.com? – Lee 2010-03-28 08:49:31
这就是故意 任何网址,所有网址都有效,有些人在随机检查错误,没有错误但不 – X10nD 2010-03-28 08:51:24