<?php
$url = 'http://www.koeri.boun.edu.tr/scripts/lasteq.asp';
$data = explode("\n", file_get_contents($url));
foreach($data as $line){
if(strpos($line, "BALIKESIR")){
$regex = '/(.*?) (.*?) (.*?) (.*?) (.*?) (.*?) (.*?) (.*) Quick/m';
preg_match($regex, trim($line," "), $matches);
var_dump($matches);
}
}
?>veriler geliyor. Ama orjinal sitedeki gibi satır satır nasıl getirebilirim?
Bu kod ile gelen verileri satır satır nasıl dizebiliriz?
5
●60
- 24-11-2021, 13:56:20
- 24-11-2021, 14:11:22doğru anladıysam eğer, html bir tablo oluştur.BoogeymaN adlı üyeden alıntı: mesajı görüntüle
sonra değerleri tabloda ilgili yerlere
$matches[0] $matches[1] $matches[2] $matches[3] $matches[4] $matches[5] $matches[6] $matches[7] $matches[8]
bu değişkenleri kullanarak yazdır. - 24-11-2021, 14:30:04Dostum böyle birşey yaptım inşallah işine yarar.
<html> <style> table, th, td { border:1px solid black; } </style> <body> <?php $url = 'http://www.koeri.boun.edu.tr/scripts/lasteq.asp'; $data = explode("\n", file_get_contents($url)); $i = 0; foreach($data as $line){ if(strpos($line, "BALIKESIR")){ $regex = '/(.*?) (.*?) (.*?) (.*?) (.*?) (.*?) (.*?) (.*) Quick/m'; preg_match($regex, trim($line," "), $matches[$i]); print_r($matches[$i]); $i++; } } ?> <br> <br> <table style="width:100%"> <?php for($j = 0;$j<count($matches);$j++){ ?> <tr> <?php for($x=0;$x<count($matches[$j]);$x++) { echo "<th>".$matches[$j][$x]."</th>"; } ?> </tr> <?php } ?> </table> - 24-11-2021, 14:50:14Çok sağolun teşekkür ediyorum. Şimdi farkettim google üzerinden deprem araması yapıp girdiğimde url değişmiş
http://www.koeri.boun.edu.tr/scripts/lst0.asp
bende değiştiğimde calısmıyor çok oluyorum ama