How do I get the next day of the week?

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

So, I tried this <?php echo date("l")+1, date("d")+1 ?> , And it tricked me: (.

+4
source share
2 answers

The following expression gives you the next day:

 date('l', time()+3600*24) 
0
source

Take a look at strtotime . In addition, l will create a full textual representation of the day of the week (for example, Friday) when using date .

Something like the following should do what you want:

 date('l', strtotime('+1 day')) 
+10
source

All Articles