Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('../simple_html_dom.php');
- $html = file_get_html('http://www.betexplorer.com/soccer/england/premier-league/results/');
- $match_dates = $html->find("td[class=h-text-right h-text-no-wrap]"); // we have 1 per match
- $titles = $html->find("td[class=h-text-left]"); // 1 per match
- $results = $html->find("td[class=h-text-center]"); // 1
- $best_bets = $html->find("span"); // 1
- $odds = $html->find("td[class=table-matches__odds]"); // 2
- $c=0; $b=0; $o=0; $z=0; // two counters
- foreach ($titles as $match) {
- list($num1, $num2) = explode(':', $results[$o]->innertext); // <- explode
- echo "<tr><td class='rtitle'>".
- "<td class='last-cell'>".$match_dates[$c]->innertext . "</td> " .
- "<td class='first-cell tl'>".$match->innertext."</td> " .
- "<td class='results'>".$results[$o++]->innertext."</td> " .
- "<td class='odds'>".$best_bets[$c++]->attr['data-odd'] . ";" .
- "".$odds[$b++]->attr['data-odd'] . ";" .
- "".$odds[$b++]->attr['data-odd'] . "</td>" .
- "</td></tr><br/>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement