true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_TIMEOUT => 25, CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_ENCODING => 'gzip, deflate', CURLOPT_USERAGENT => 'Mozilla/5.0', ]); $html = curl_exec($ch); curl_close($ch); return $html ?: ''; } function xpath_new($html){ libxml_use_internal_errors(true); $dom = new DOMDocument(); $dom->loadHTML('' . $html); libxml_clear_errors(); return new DOMXPath($dom); } function xp_first_text(DOMXPath $xp, DOMNode $ctx, $q){ $n = $xp->query($q, $ctx); if ($n && $n->length) return trim(preg_replace('/\s+/u',' ',$n->item(0)->textContent)); return null; } function xp_first_attr(DOMXPath $xp, DOMNode $ctx, $q, $attr){ $n = $xp->query($q, $ctx); if ($n && $n->length) { $el = $n->item(0); $v = $el->getAttribute($attr); return $v !== '' ? $v : null; } return null; } function clean_team_name(?string $s): string { $s = (string)$s; $s = preg_replace('/[&#].*$/u', '', $s); $s = preg_replace('/\s+/u', ' ', $s); $s = trim($s, " \t\n\r\0\x0B-–—·•|"); return trim($s); } $p = max(1, (int)($_GET['p'] ?? 1)); $bg = trim((string)($_GET['bg'] ?? '')) ?: BG_IMG; $srcUrl = BASE . SRC_PATH . '?page=' . $p; $html = http_get($srcUrl); $xp = xpath_new($html); $cards = $xp->query("//div[contains(@class,'card') and contains(@class,'matches')]"); $matches = []; foreach ($cards as $card) { $date = xp_first_text($xp, $card, ".//div[contains(@class,'date-match')]"); $home_name = xp_first_text($xp, $card, ".//div[contains(@class,'team-home')]//div[1]"); $home_img = xp_first_attr($xp, $card, ".//div[contains(@class,'team-home')]//img", "src"); $away_name = xp_first_text($xp, $card, ".//div[contains(@class,'team-away')]//div[1]"); $away_img = xp_first_attr($xp, $card, ".//div[contains(@class,'team-away')]//img", "src"); $score = xp_first_text($xp, $card, ".//div[contains(@class,'score')]"); $league_bottom = xp_first_text($xp, $card, ".//div[contains(@class,'status') and not(contains(@class,'green'))]"); $league_top = xp_first_text($xp, $card, ".//div[contains(@class,'status') and contains(@class,'green')]"); $home_name = clean_team_name($home_name); $away_name = clean_team_name($away_name); $detail = xp_first_attr($xp, $card, ".//a[contains(@class,'toDetail')]", "href"); if ($detail && strpos($detail, 'http') !== 0) $detail = BASE . $detail; $is_live = false; $liveNode = $xp->query(".//div[contains(@class,'bet')]//h5[contains(@class,'live-match')]", $card); if ($liveNode && $liveNode->length && strtoupper(trim($liveNode->item(0)->textContent)) === 'LIVE') $is_live = true; $matches[] = [ 'date' => $date ?: 'N/A', 'home' => $home_name, 'home_img' => $home_img, 'away' => $away_name, 'away_img' => $away_img, 'time_or_score'=> $score ?: '', 'league_top' => $league_top ?: '', 'league' => $league_bottom ?: '', 'detail' => $detail, 'is_live' => $is_live, ]; } $paginationLinks = []; if ($aNodes = $xp->query("//a[contains(@href,'?page=')]")) { foreach ($aNodes as $a) { $href = $a->getAttribute('href'); if (preg_match('/[?&]page=(\d+)/', $href, $m)) $paginationLinks[(int)$m[1]] = true; } } $totalPages = max(1, !empty($paginationLinks) ? max(array_keys($paginationLinks)) : 1); $byDate = []; foreach ($matches as $m){ $byDate[$m['date']][] = $m; } function build_url($page){ $params = $_GET; $params['p'] = $page; unset($params['q'], $params['live']); return '?' . http_build_query($params); } ?> Lịch trực tiếp bóng đá
Lịch trực tiếp bóng đá
🚫 BANNER CHE QUẢNG CÁO
Đang tải video...
Không có trận phù hợp ở trang .
$items): ?>
$m): ?>

Sample Page

This is an example page. It’s different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:

Hi there! I’m a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like piña coladas. (And gettin’ caught in the rain.)

…or something like this:

The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.

As a new WordPress user, you should go to your dashboard to delete this page and create new pages for your content. Have fun!