Jump to content

[SOLVED] Dates and array issue


Maracles

Recommended Posts

I have a table in which every row is a consecutive day i.e. row 1 is 'July 1st', row 2 is 'July 2nd' and so forth. The first column is for actual date in the format of; dd-mm-yy, the second column is day; Mon, Tue and so forth.

 

There are 28 rows for every table i.e. 28 days.

 

The table is created by a for loop and the first date is based on a variable I have called $startdate (the start date changes depending on the page the table is on). I would like help with a code that does two things.

 

1. Every time the for loop creates a new row I need the date in the first column to increase by one so that each row has the next sequential date, however I need it to take into account the yearly calendar i.e. when it gets to 28th February the next date should be 1st March.

 

2. The second column simply needs show the days but in line with the actual date.

 

I have tried using an array but can't seem to get it work properly, is this the correct way or is there something better I should be using?

 

If any one can help it would be much appreciated. The big about getting in line with the yearly calendar is what's throwing me off in particular.

 

 

Link to comment
https://forums.phpfreaks.com/topic/179274-solved-dates-and-array-issue/
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.