Jump to content

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

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.