Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $String = file_get_contents('https://en.wikipedia.org/wiki/Template:2019–20_coronavirus_pandemic_data');
- function Cases($sp1, $sp2, $sp3)
- {
- $num1 = strpos($sp1, $sp2);
- if($num1 === false) return 0;
- $num2 = substr($sp1, $num1);
- $result = strip_tags(substr($num2, 0, strpos($num2, $sp3)));
- // print_r($result);
- function multiexplode ($delimiters,$string) {
- $ready = str_replace($delimiters, $delimiters[0], $string);
- $launch = explode($delimiters[0], $ready);
- return $launch;
- }
- $res = multiexplode(array('‍','[',']'), $result);
- $r = array_slice($res, 6);
- $t = array_slice($r, 0, 575);
- //$st = strip_tags($t, ['<br>']);
- foreach ($t as $key=>$item)
- {
- echo "$key => $item <br>";
- }
- }
- Cases($String, '<tr>', '</tbody>');
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <style>
- #customers {
- font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
- border-collapse: collapse;
- width: 100%;
- }
- #customers td, #customers th {
- border: 1px solid #ddd;
- padding: 8px;
- }
- #customers tr:nth-child(even){background-color: #f2f2f2;}
- #customers tr:hover {background-color: #ddd;}
- #customers th {
- padding-top: 12px;
- padding-bottom: 12px;
- text-align: left;
- background-color: red;
- color: white;
- }
- </style>
- </head>
- <body>
- <table id="customers">
- <tr>
- <th>Countries</th>
- <th>Cases</th>
- <th>Deaths</th>
- <th>Recov.</th>
- </tr>
- <tr>
- <td>Contents</td>
- </tr>
- <tr>
- <td>Contents</td>
- </tr>
- <tr>
- <td>Contents</td>
- </tr>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement