Jump to content

weeknumbers in tables


reijm1

Recommended Posts

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>

A2M
7688
15-5-2013 19:30:00
IJsselvogels A2
DVS '69 A1
7
8


 

</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>


<?php
foreach ($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 team1
result team2
etc.

week 13:
result team1
result team2
etc.

can you help?

Link to comment
https://forums.phpfreaks.com/topic/278220-weeknumbers-in-tables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.