<?xml version="1.0" encoding="utf-8"?> <moviedata> <movie id ="sean"> <name>Dr no</name> <stime>09:00</stime> <etime>11:00</etime> </movie> <movie id ="mathew"> <name>Dr yes</name> <stime>09:00</stime> <etime>11:00</etime> </movie> <movie id ="roger"> <name>Moonraker</name> <stime>13:00</stime> <etime>14:00</etime> </movie> <movie id ="sean"> <name>Thunderball</name> <stime>01:00</stime> <etime>02:30</etime> </movie> <movie id ="sean"> <name>Thunderballl</name> <stime>02:35</stime> <etime>04:30</etime> </movie> <movie id ="george"> <name>Winter Break </name> <stime>22:00</stime> <etime>23:00</etime> </movie> <movie id ="sean"> <name>Living Daylights</name> <stime>22:00</stime> <etime>23:00 </etime> </movie> <movie id ="daniel"> <name> Skyfall </name> <stime> 11:00 </stime> <etime> 12:00 </etime> </movie> <movie id ="daniel"> <name> Casino Royale </name> <stime> 12:00 </stime> <etime> 14:00 </etime> </movie> <movie id ="pierce"> <name> GoldenEye </name> <stime> 11:00 </stime> <etime> 13:00 </etime> </movie> </moviedata>
SimpleXMLElement implements Traversable { /* Methods */ final public __construct ( string $data [, int $options = 0 [, bool $data_is_url = false [,string $ns = "" [, bool $is_prefix = false ]]]] ) public void addAttribute ( string $name [, string $value [, string $namespace ]] ) public SimpleXMLElement addChild ( string $name [, string $value [, string $namespace ]] ) public mixed asXML ([ string $filename ] ) public SimpleXMLElement attributes ([ string $ns = NULL [, bool $is_prefix = false ]] ) public SimpleXMLElement children ([ string $ns [, bool $is_prefix = false ]] ) public string getName ( void ) public bool registerXPathNamespace ( string $prefix , string $ns ) public string __toString ( void ) } $movies = new SimpleXMLElement($this->xmlString);
require ('class.tvSchedule.php');
$movies = new SimpleXMLElement($this->xmlString); foreach ($movies->movie as $element) { //set channel name for current listing //print_r($element); $name = ""; $etime =""; $stime =""; //echo $channel; foreach($element as $key => $val) { //assign variables for use in building listings array. if($key == 'channel'){ } if($key == 'name'){ // echo "booo"; } if($key == 'etime'){ //echo $etime; }if($key == 'stime'){ } // echo str_replace(" ", "_", $name); //Add listing to correct channel removing white space within the listing name and replacing with "_" //as a by product a empty element was created remove it. } }
$list = $tvSchedule->getChannelList(); foreach($list as $key => $value){ echo '<a href="#" class="list-group-item">'.$value.' </a>'; }
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.