• 01-08-2023, 14:55:51
    #1
    Yine ofiste sıkıntıdan sardığım başka bir kodu paylaşmak istedim arkadaşlar. sonuçları TFF'nin sitesinden çekiyor. $url yazan kısım 2023-2024 sezonuna ait. Geçmiş sezonların puan durumunu ekrana döktürmek isteyenler aşağıdaki linkteki sezon linklerini $url yerine yazıp kodu çalıştırabilir.

    https://www.tff.org/default.aspx?pageID=545


    Paylaştığım Diğer Hazır Kodlar;
    Süper Lig Puan Durumu (PHP)
    Son Deprem Verileri (PHP)
    Javascript ile Klavye Hız Testi
    Javascript ile Vücut Kitle İndeksi Hesaplama
    Javascript ile Kredi Hesaplama





    Çıktı;



    <?php
    $curl = curl_init();
    $url = 'https://www.tff.org/default.aspx?pageID=198';
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $html = curl_exec($curl);
    curl_close($curl);
    $dom = new DOMDocument();
    libxml_use_internal_errors(true);
    $dom->loadHTML($html);
    libxml_clear_errors();
    $xpath = new DOMXPath($dom);
    $table = $xpath->query('//table[contains(@class, "s-table")]')->item(0);
    if ($table) {
        $rows = $table->getElementsByTagName('tr');
        $headerRow = $rows->item(0);
        $headers = $headerRow->getElementsByTagName('span');
        $columnCount = $headers->length;
        echo "<style>";
        echo "table { border-collapse: collapse; width: 100%; max-width: 800px; margin: 0 auto; font-family: Arial, sans-serif; }";
        echo "th, td { padding: 8px; text-align: left; border-bottom: 1px solid #ddd; }";
        echo "th { background-color: #f2f2f2; }";
        echo "tr:hover { background-color: #f5f5f5; }";
        echo "th:last-child, td:last-child { text-align: right; }";
        echo "</style>";
        echo "<table>";
        echo "<tr>";
        echo "<th></th>";
        for ($i = 0; $i < $columnCount; $i++) {
            echo "<th>" . $headers->item($i)->nodeValue . "</th>";
        }
        echo "</tr>";
        for ($i = 1; $i < $rows->length; $i++) {
            echo "<tr>";
            $cells = $rows->item($i)->getElementsByTagName('td');
            $titleCell = $cells->item(0);
            echo "<td>" . $titleCell->nodeValue . "</td>";
            for ($j = 1; $j < $columnCount; $j++) {
                echo "<td>" . $cells->item($j)->nodeValue . "</td>";
            }
            $pointsCell = $cells->item($columnCount - 1);
            echo "<td>" . $pointsCell->nodeValue . "</td>";
            echo "</tr>";
        }
        echo "</table>";
    } else {
        echo "Tablo bulunamadı!";
    }
    ?>
  • 14-08-2023, 23:47:05
    #2
    Üyeliği durduruldu
    PetitJoueur adlı üyeden alıntı: mesajı görüntüle
    Yine ofiste sıkıntıdan sardığım başka bir kodu paylaşmak istedim arkadaşlar. sonuçları TFF'nin sitesinden çekiyor. $url yazan kısım 2023-2024 sezonuna ait. Geçmiş sezonların puan durumunu ekrana döktürmek isteyenler aşağıdaki linkteki sezon linklerini $url yerine yazıp kodu çalıştırabilir.

    https://www.tff.org/default.aspx?pageID=545


    Paylaştığım Diğer Hazır Kodlar;
    Süper Lig Puan Durumu (PHP)
    Son Deprem Verileri (PHP)
    Javascript ile Klavye Hız Testi
    Javascript ile Vücut Kitle İndeksi Hesaplama
    Javascript ile Kredi Hesaplama





    Çıktı;



    <?php
    $curl = curl_init();
    $url = 'https://www.tff.org/default.aspx?pageID=198';
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $html = curl_exec($curl);
    curl_close($curl);
    $dom = new DOMDocument();
    libxml_use_internal_errors(true);
    $dom->loadHTML($html);
    libxml_clear_errors();
    $xpath = new DOMXPath($dom);
    $table = $xpath->query('//table[contains(@class, "s-table")]')->item(0);
    if ($table) {
        $rows = $table->getElementsByTagName('tr');
        $headerRow = $rows->item(0);
        $headers = $headerRow->getElementsByTagName('span');
        $columnCount = $headers->length;
        echo "<style>";
        echo "table { border-collapse: collapse; width: 100%; max-width: 800px; margin: 0 auto; font-family: Arial, sans-serif; }";
        echo "th, td { padding: 8px; text-align: left; border-bottom: 1px solid #ddd; }";
        echo "th { background-color: #f2f2f2; }";
        echo "tr:hover { background-color: #f5f5f5; }";
        echo "th:last-child, td:last-child { text-align: right; }";
        echo "</style>";
        echo "<table>";
        echo "<tr>";
        echo "<th></th>";
        for ($i = 0; $i < $columnCount; $i++) {
            echo "<th>" . $headers->item($i)->nodeValue . "</th>";
        }
        echo "</tr>";
        for ($i = 1; $i < $rows->length; $i++) {
            echo "<tr>";
            $cells = $rows->item($i)->getElementsByTagName('td');
            $titleCell = $cells->item(0);
            echo "<td>" . $titleCell->nodeValue . "</td>";
            for ($j = 1; $j < $columnCount; $j++) {
                echo "<td>" . $cells->item($j)->nodeValue . "</td>";
            }
            $pointsCell = $cells->item($columnCount - 1);
            echo "<td>" . $pointsCell->nodeValue . "</td>";
            echo "</tr>";
        }
        echo "</table>";
    } else {
        echo "Tablo bulunamadı!";
    }
    ?>
    https://www.tff.org/default.aspx?pageID=198

    Bu sayfadaki hersey olursa muhtesem olur ustad..
    Eline saglik.
  • 14-08-2023, 23:48:49
    #3
    Eline sağlık