среда, 27 декабря 2017 г.

Как проверить наличие страницы сайта

<?php 
$site    
= array(); $site[]    = '/Users/dan/Documents/php_manual/function.fopen.html'; $site[]    = 'http://phpclub.ru/talk/showthread.php?s=&threadid=68408&rand=0'; $site[]    = 'http://wikipedia.sourceforge.net/'; $site[]    = 'http://what.a.site.is.this/?'; 


foreach (
$site as $url) 
{ 
    if( 
fopen($url"r") )  
        echo 
"<a href='$url'>$url</a><br/>"; 
} 
?> 

p.s. if( @fopen($url, "r") ) 

Комментариев нет:

Отправить комментарий