Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Loadxml{
- public function __construct($xmlFile){
- $this->xmlFile = simplexml_load_file($xmlFile);
- foreach($this->xmlFile->song as $file){
- $this->sort[] = $file;
- }
- }
- public function display(){
- echo'<table border="1">
- <tr>
- <td>Title</td>
- <td>Artist</td>
- <td>Duration</td>
- <td>Release</td>
- <td>Category</td>';
- foreach($this->sort as $new){
- echo'<tr><td>' . $new->title . '</td>
- <td>' . $new->artist . '</td>
- <td>' . $new->duration . '</td>
- <td>' . $new->release . '</td>
- <td>' . $new->category . '</td>';
- }
- echo'</tr></table>';
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement