check if link “still” exists [duplicate]

This might do

function checkLink($link){ 
    flush(); 
    $fp = @fopen($link, "r"); 
    @fclose($fp); 
    if (!$fp){ 
        return "link is not active"; 
    }else{ 
        return "link is active"; 
    } 
} 

Leave a Comment