Skip to content

Instantly share code, notes, and snippets.

@rubenleikarnes
Created October 31, 2018 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubenleikarnes/4efaef185cbb2b13b705d4a017938849 to your computer and use it in GitHub Desktop.
Save rubenleikarnes/4efaef185cbb2b13b705d4a017938849 to your computer and use it in GitHub Desktop.
<?php
$url = 'http://clipsource.se/epg/api?key=1d795361b98aa0cb2d2ec6aaaeb09400c32ebae4e79cbae6f61c198e38494bb1&date=2018-10-31&channelId=no.viasat.sport.plus';
$xml = simplexml_load_file($url) or die("Error: Cannot create object");
foreach ($xml->contentList->content as $test) {
$size = count($test->titleList->title);
for ($i = 0; $i < $size; $i++) {
if($test->titleList->title[$i]->attributes()->type == "content") {
echo "<p>" . $test->titleList->title[$i]->title . "</p>";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment