thieumao

simplehtmldom - Lấy Kết Quả Xổ Số

Nov 24th, 2013
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. <?php
  2.  
  3. include('../simplehtmldom/simple_html_dom.php');
  4.  
  5. // -----------------------------------------------------------------------------
  6.  
  7. $phancach = "---------------------------------------------------------------------------- <br/>";
  8.  
  9. // Retrieve the DOM from a given URL
  10. $html = file_get_html('http://ketquaxoso.24h.com.vn/');
  11.  
  12. // Find all TD tags with "class=number_kq]"
  13. $i = 0;
  14. foreach($html->find('td[class=number_kq]') as $e) {
  15.     switch ($i) {
  16.     case 0:
  17.         echo $phancach;
  18.         break;     
  19.     case 7:
  20.         echo $phancach;
  21.         break;
  22.     case 17:
  23.         echo $phancach;
  24.         break;
  25.     case 26:
  26.         echo $phancach;
  27.         break;
  28.     case 35:
  29.         echo $phancach;
  30.         break;
  31.     case 44:
  32.         echo $phancach;
  33.         break;
  34.     case 53:
  35.         echo $phancach;
  36.         break;
  37.     case 62:
  38.         echo $phancach;
  39.         break;
  40.     }
  41.     echo ++$i . " -->  " . $e->innertext . '<br>';
  42. }
  43.    
  44.  
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment