title: parse XML TV listings, find out what is playing now
body: <p>i have an XML file of TV listings, TV.xml:</p>
  
  <pre><code>http://wklej.to/j4GQm
  </code></pre>
  
  <p>I would like to create some kind of epg for website from this. As i have no experience, it is unfortunately hard for me. I would like to get specific channel data, then compare it to the actual time, and show what is playing now on this channel (and what will play afterwards).</p>
  
  <p>What i try:</p>
  
  <pre><code> &lt;?php
  $xml=simplexml_load_file("TV.xml");
  $me = "sub-title";
  foreach($xml-&gt;programme as $item){
      echo "Start : " .date("G:i d.m.Y", strtotime(substr($item["start"], 0,  -6))) . '&lt;br&gt;';
      echo "End : " .date("G:i d.m.Y", strtotime(substr($item["stop"], 0,  -6))) . '&lt;br&gt;';
      echo "Channel : ".$item["channel"]. "&lt;br&gt;";
      echo "Title : ".$item-&gt;title. "&lt;br&gt;";
      echo "Info : ".$item-&gt;$me. "&lt;br&gt;";
      echo "Description : ".$item-&gt;desc. "&lt;br&gt;";
      echo "&lt;br&gt;";
  }
  ?&gt; 
  </code></pre>
  
  <p>So i would have a list of channels. But how do I show the specific channel info? Not the whole list. And the most important, how to compare it with the actual time and show only the program that is playing now?</p>