• 24-11-2021, 13:56:20
    #1
    <?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?
  • 24-11-2021, 14:11:22
    #2
    BoogeymaN adlı üyeden alıntı: mesajı görüntüle
    <?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?
    doğru anladıysam eğer, html bir tablo oluştur.
    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:14:10
    #3
    @BoogeymaN;

    var_dump olan yeri sil şunu yaz

    echo $matches[0]."<br>";
  • 24-11-2021, 14:30:04
    #4
    Dostum 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
    #5
    Ç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
  • 24-11-2021, 15:43:31
    #6
    @BoogeymaN; hocam aynı kodlar ile çalışıyor. Sadece Quick bunu silmeniz gerekiyor. Aynı şekilde verileri alabilirsiniz.