4

Like if today is Thursday, then I want to display Friday using php date() function. For example, the below code will show the current month but the next day of the month. It worked. <?php echo date("M "), date("d")+1 ?>

So I was trying through this one <?php echo date("l")+1, date("d")+1 ?> and it fooled me :(.

Will Vousden
  • 32,488
  • 9
  • 84
  • 95
Shahriar Kabir
  • 274
  • 1
  • 9
  • 26
  • Recommending searching before posting. Duplicate: http://stackoverflow.com/questions/5883571/get-next-and-previous-day-with-php Generalized: http://stackoverflow.com/questions/5532002/next-business-day-of-given-date-in-php – JSuar Dec 13 '12 at 22:46
  • Actually that question isn't as clear as mine, I hope this question far better than that to understand for beginners. You see my question was so simple and clear hence I got neat & clean answer. Thanks anyway. – Shahriar Kabir Dec 13 '12 at 23:08

2 Answers2

10

Have a look at strtotime. Also, an l will produce a full textual representation of the day of the week (e.g. Friday) when using date.

Something like the following should do what you want:

date('l', strtotime('+1 day'))
Will Vousden
  • 32,488
  • 9
  • 84
  • 95
0

The following expression gives you the next day:

date('l', time()+3600*24)
Muatik
  • 4,011
  • 10
  • 39
  • 72