Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.