thieumao

Kết quả xố sổ miền Bắc

Nov 25th, 2013
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. <?php
  2.  
  3. include('../simplehtmldom/simple_html_dom.php');
  4.  
  5. // -----------------------------------------------------------------------------
  6.  
  7. // Retrieve the DOM from a given URL
  8. $html = file_get_html('http://ketquaxoso.24h.com.vn/');
  9.  
  10. $mbso=array("DB","G1","G2","G3","G4","G5","G6","G7");
  11.  
  12. // Find all TD tags with "class=number_kq]"
  13. $i = 0;
  14. foreach($html->find('td[class=number_kq]') as $e) {
  15.     if ($i <8) {
  16.         $mbso[$i] = $e->innertext;
  17.         $i++;
  18.     }
  19. }
  20.  
  21. echo json_encode($mbso);
  22.    
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment