<?php
setlocale
(LC_ALL'tr_TR''tr''turkish');
if(
function_exists("date_default_timezone_set")) {
    
date_default_timezone_set('Europe/Istanbul');
}
function 
son_depremler($sayi=5) {
    
$contents=file_get_contents("http://www.koeri.boun.edu.tr/scripts/lst9.asp");
    
$pattern='/(\d{4})\.(\d{2})\.(\d{2})\s(\d{2}):(\d{2}):(\d{2})\s+(\d{2}\.\d{4})\s+(\d{2}\.\d{4})\s+(\d+\.\d)\s+([\d\.-\s]+)(.+)/';
    
preg_match_all($pattern,$contents,$out);
    unset(
$out[0]);
    
$depremler=array();
    for(
$i=0$i<$sayi$i++) {
        
$depremler[]=array('timestamp' => mktime($out[4][$i],$out[5][$i],$out[6][$i],$out[2][$i],$out[3][$i],$out[1][$i]), 'enlem' => $out[7][$i], 'boylam' => $out[8][$i], 'derinlik' => $out[9][$i], 'buyukluk' => trim(str_replace("-.-","",$out[10][$i])), 'yer' => trim($out[11][$i]));
    }
    unset(
$out);
    return 
$depremler;
}
foreach(
son_depremler(3) as $deprem) {
    echo 
strftime("%d %B %Y, %A %H:%M:%S"$deprem[timestamp]);
    echo 
"\r\n<br />\r\n";
    echo 
"Enlem: ".$deprem[enlem];
    echo 
"\r\n<br />\r\n";
    echo 
"Boylam: ".$deprem[boylam];
    echo 
"\r\n<br />\r\n";
    echo 
"Derinlik: ".$deprem[derinlik];
    echo 
"\r\n<br />\r\n";
    echo 
"Büyüklük: ".$deprem[buyukluk];
    echo 
"\r\n<br />\r\n";
    echo 
"Yer: ".$deprem[yer];
    echo 
"\r\n<br />\r\n<br />\r\n";
}
?>