Best way to show written date and some weekend rules

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
User avatar
simplypixie
php-forum Active User
php-forum Active User
Posts: 300
Joined: Sun Dec 11, 2011 12:51 am
Location: Shrewsbury, Shropshire
Contact:

Re: Best way to show written date and some weekend rules

Post by simplypixie » Tue Oct 22, 2013 11:14 pm

This is what you need:

Code: Select all

<?php
	                  $date = date("l\, F j", strtotime("tomorrow"));
	                  $day = date('l', strtotime('tomorrow'));
	                  if ($day == 'Friday' || $day == 'Saturday' || $day == 'Sunday') {
	                  	echo 'Monday';
	                  } else {
	                  	echo $date;
	                  }
                  ?>

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests