這裏的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