Source: accesslog.phps - download
<?php
$accesslog 
"/home/daif/logs/access.log"//access.log path
$fp fopen($accesslog,'r');
while (!
feof($fp)) {
    
preg_match('/(.+) - - \[(.+)\] "(.+) (.+) (.+)" (\d+) (.+)/Usi',fgets($fp),$log);
    if(
$log[6] == '404'){ //page not found
        
print "$log[1] - <a href=$log[4]>$log[4]</a> $log[6]<br />\n";
    }
}
fclose($fp);
?>