note 109303 modified in function.date by danbrown

From: Date: Mon, 16 Jul 2012 15:50:48 +0000
Subject: note 109303 modified in function.date by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-189231@lists.php.net to get a copy of this message
here is an example how you can make numeric days of the week from 1 to 7(Monday to Friday) 

<?php
$currentdate = mktime(0, 0, 0, date("m") , date("d"), date("Y"));
 	echo $day_eg1 = date ('N',$currentdate);
 echo $day_eg2 = date("N", $today+1 * 24 * 3600);
	echo $day_eg3= date("N", $today+2 * 24 * 3600);
	echo $day_eg4 = date("N", $today+3 * 24 * 3600);
	echo $day_eg5 = date("N", $today+4 * 24 * 3600);
	echo $day_eg6 = date("N", $today+5 * 24 * 3600);
	echo $day_eg7 = date("N", $today+6 * 24 * 3600);
?> --was-- here is an example how you can make numeric days of the week from 1 to 7(Monday to Friday) $currentdate = mktime(0, 0, 0, date("m") , date("d"), date("Y")); echo $day_eg1 = date ('N',$currentdate); echo $day_eg2 = date("N", $today+1 * 24 * 3600); echo $day_eg3= date("N", $today+2 * 24 * 3600); echo $day_eg4 = date("N", $today+3 * 24 * 3600); echo $day_eg5 = date("N", $today+4 * 24 * 3600); echo $day_eg6 = date("N", $today+5 * 24 * 3600); echo $day_eg7 = date("N", $today+6 * 24 * 3600); http://php.net/manual/en/function.date.php

« previous php.notes (#189231) next »