Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta charset="utf-8">
- <style>
- table#demo
- {
- font-size : 12px;
- padding : 5px;
- }
- table#demo th
- {
- text-align : left;
- background-color: #555555;
- color : #FFFFFF;
- }
- table#demo tr:nth-child(odd) {background-color: #EEEEEE;}
- table#demo tr:nth-child(even) {background-color: #CCCCCC;}
- table#demo tr td
- {
- padding-right : 25px;
- }
- </style>
- </head>
- <body>
- <?php
- $xml = simplexml_load_file("http://www.odin.dk/RSS/RSS.aspx?beredskabsID=bbbbbbbb-1111-2222-3333-bbbbbbbbbbbb");
- echo "<table id='demo'>";
- echo "<tr>";
- echo "<th>title</th>";
- echo "<th>description</th>";
- echo "<th>comments</th>";
- echo "<th>pubDate</th>";
- echo "<th>title</th>";
- echo "</tr>";
- foreach($xml->children() as $child)
- {
- foreach ($child as $c)
- {
- if ($c->getname() == "item")
- {
- echo "<tr>";
- echo "<td>".$c->title."</td>";
- echo "<td>".$c->description."</td>";
- echo "<td>".$c->comments."</tdr>";
- echo "<td>".$c->pubDate."</td>";
- echo "<td>".$c->title."</td>";
- echo "</tr>";
- }
- }
- }
- echo "</table>";
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement