note 97757 added to function.strtotime
| From: | support at esoweb dot eu | Date: | Thu, 06 May 2010 15:47:32 +0000 |
| Subject: | note 97757 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-169019@lists.php.net to get a copy of this message | ||
This an example of recurrence days.
This function return a recurrence day per week during a period.
Exemple: All Thurday starting from 06 May 2010 during 52 weeks.
<?php
//function
function nextWeeksDay($date_begin,$nbrweek)
{
$nextweek=array();
for($i = 1; $i <= $nbrweek; $i++) { // 52 week in one year of course
$nextweek[$i]=date('D d M Y', strtotime('+'.$i.' week',$date_begin));
}
return $nextweek;
}
/// end function
/// example of a select date
// var
$date_begin = strtotime('06-05-2010'); //D Day Month Year - like function format.
$nbrweek=52;
// call function
$result=nextWeeksDay($date_begin,$nbrweek);
// Preview
for($i = 1; $i <= $nbrweek; $i++) {
echo '<br> - '.$result[$i];
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 194.11.79.46
----
Manual Page -- http://www.php.net/manual/en/function.strtotime.php
Edit -- https://master.php.net/note/edit/97757
Del: integrated -- https://master.php.net/note/delete/97757/integrated
Del: useless -- https://master.php.net/note/delete/97757/useless
Del: bad code -- https://master.php.net/note/delete/97757/bad+code
Del: spam -- https://master.php.net/note/delete/97757/spam
Del: non-english -- https://master.php.net/note/delete/97757/non-english
Del: in docs -- https://master.php.net/note/delete/97757/in+docs
Del: other reasons-- https://master.php.net/note/delete/97757
Reject -- https://master.php.net/note/reject/97757
Search -- https://master.php.net/manage/user-notes.php