I have a simple XML table with dates dates.xml
<schedule> <day> <date>01.03.17</date> <dayname>Thursday</dayname> <htime1>2:00</htime1> <htime2>3:00</htime2> </day> <day> <date>02.03.17</date> <dayname>Friday</dayname> <htime1>1:00</htime1> <htime2>4:00</htime2> </day> <day> <date>03.03.17</date> <dayname>Saturday</dayname> <htime1>0:00</htime1> <htime2>7:00</htime2> </day> ... </schedule>
I want to a load list of the next 10 days, beginning with the current day from today. I've found a way, to import the xml-table by using simplexml_load.
<?php
$xml=simplexml_load_file("dates.xml");
echo '<li>';
echo $xml->date . "<br>";
echo $xml->dayname . "<br>";
echo $xml->htime1 . "<br>";
echo $xml->htime2;
echo '</li>';
?>
Is is possible to start a loop, beginning from the current day? e.g. Today is the 2th of March. The list should be like this:
02.03.17 Friday 1:00 4:00 03.03.17 Saturday 1:00 4:00 04.03.17 Sunday 1:00 4:00 ...Do you have any idea, how to do this? Thank you!