jeff5656 Posted July 25, 2008 Share Posted July 25, 2008 I want to display the date of next friday. The following code does work: <?php $next_friday = date('n/d/Y',strtotime('next friday')); ?> BUT if today is friday I want it to display today's date. Only on saturday do I want it to display next friday's date. How do I do that and still assign it to the variable $next_friday? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/116645-solved-display-date-of-next-friday/ Share on other sites More sharing options...
jonsjava Posted July 25, 2008 Share Posted July 25, 2008 <?php if (date("l") == "Friday"){ $next_friday = date("n/d/Y"); } else{ $next_friday = date('n/d/Y',strtotime('next friday')); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/116645-solved-display-date-of-next-friday/#findComment-599745 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.