Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('../simplehtmldom/simple_html_dom.php');
- // -----------------------------------------------------------------------------
- $phancach = "---------------------------------------------------------------------------- <br/>";
- // Retrieve the DOM from a given URL
- $html = file_get_html('http://ketquaxoso.24h.com.vn/');
- // Find all TD tags with "class=number_kq]"
- $i = 0;
- foreach($html->find('td[class=number_kq]') as $e) {
- switch ($i) {
- case 0:
- echo $phancach;
- break;
- case 7:
- echo $phancach;
- break;
- case 17:
- echo $phancach;
- break;
- case 26:
- echo $phancach;
- break;
- case 35:
- echo $phancach;
- break;
- case 44:
- echo $phancach;
- break;
- case 53:
- echo $phancach;
- break;
- case 62:
- echo $phancach;
- break;
- }
- echo ++$i . " --> " . $e->innertext . '<br>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment