<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://sport.mthai.com/league-table/bundes-liga");
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_TIMEOUT, 45);
$html_result = curl_exec($ch);
curl_close($ch);
$dom = new DOMDocument();
@$dom->loadHTML($html_result);
$xpath = new DOMXPath($dom);
$start_result = strpos($html_result,'<div class="table-scroll">');
$end_result = strpos($html_result,'</div>',$start_result);
echo substr($html_result,$start_result,$end_result-$start_result);
?>
ผมจะดึงตารางคะแนนจากเว็บ
https://sport.mthai.com/league-table/bundes-liga แต่แท็กปิด </div> มันไม่มาครับผมต้องแก้ยังไงครับ
มันมาเริ่มจาก <div class="table-scroll"> แต่แท็กปิด </div> มันหายไปครับ