Jump to content

Recommended Posts

I am creating an avaliability calendar, however I am using a flat file database, as my client doesn't have SQL installed on his host. I have created some loops to show through 12 calendars for each house he has avaliable to rent. I get the current month by using the date as in code below and have a different txt file for each month which it loads then outputs a table calendar according to its state, booked, avaliable etc as a td css class.

 

$start = date('m');
$start ++;
$start --;

 

However I increase it by one then decrease it by one to get rid of the prevailing zero, is there a better way to do this? Or can I keep the prevailing zero and increment 1 each time keeping it as it should be, 02, 03, 04 etc by using ++.

 

Hope this makes sense.

 

I haven't been using PHP for very long,

 

Many Thanks

Link to comment
https://forums.phpfreaks.com/topic/38306-solved-date-month-format/
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.