reijm1 Posted May 20, 2013 Share Posted May 20, 2013 Hi All, I`m pretty new with php but i`m trying to build a mobile page with xml extraction. I`m getting my xml data from an externa site trough simplexml and I want to sort this data on weeknumber, and within the weeknumber on team.The xml data that i`m requesting is <Datum_Tijd> and I want to transform it to a weeknumber.: xml code: <code>A2M768815-5-2013 19:30:00IJsselvogels A2DVS '69 A178 </code> Until now I have this to witdraw my content: <code> <table cellpadding="1px" width="100%"><tr align="left"><th>Datum</th><th>Tijd</th><th>Thuis Ploeg</th><th>Uit Ploeg</th><th>Uitslag</th></tr><?phpforeach ($xml->row AS $info ) {?><tr class="<?php echo ($clrCounter++ % 2 == 0 ? 'odd' : 'even'); ?>"><td><?php $date = date_create($info -> Datum_Tijd); echo date_format($date, 'd-m');?></td><td><?php $date = date_create($info -> Datum_Tijd); echo date_format($date, 'H:i');?></td><td <?php if (strpos($info -> Thuisploeg,'IJsselvogels') !== false) {echo 'style="color: #FF0000;"';} ?> ><?php echo $info -> Thuisploeg ?></td><td <?php if (strpos($info -> Uitploeg,'IJsselvogels') !== false) {echo 'style="color: #FF0000;"';} ?> ><?php echo $info -> Uitploeg ?></td><td><?php echo $info -> Scorethuis . " - " . $info -> Scoreuit ?></td></tr><? }?> </code> But I want: Week 14: result team1result team2etc.week 13:result team1result team2etc.can you help? Link to comment https://forums.phpfreaks.com/topic/278220-weeknumbers-in-tables/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.