note 85478 added to function.mktime
| From: | ooogla at hotmail dot com | Date: | Mon, 01 Sep 2008 22:56:14 +0000 |
| Subject: | note 85478 added to function.mktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-144060@lists.php.net to get a copy of this message | ||
If you want to increment the day based on a variable when using a loop you can use this when you
submit a form
1. Establish a start date and end date in two different variables
2. Get the number of days between a date
$ndays = (strtotime($_POST['edate']) - strtotime($_POST['sdate'])) / (60 * 60 *
24);
Then here is the string you slip in your loop
$nextday = date('Y-m-d', mktime(0, 0, 0, date("m",
strtotime($_POST['sdate'])) , date("d", strtotime($_POST['sdate']))+
$count, date("Y", strtotime($_POST['sdate']))));
$count is incremented by the loop.
----
Server IP: 64.71.164.2
Probable Submitter: 75.134.95.203
----
Manual Page -- http://www.php.net/manual/en/function.mktime.php
Edit -- https://master.php.net/note/edit/85478
Del: integrated -- https://master.php.net/note/delete/85478/integrated
Del: useless -- https://master.php.net/note/delete/85478/useless
Del: bad code -- https://master.php.net/note/delete/85478/bad+code
Del: spam -- https://master.php.net/note/delete/85478/spam
Del: non-english -- https://master.php.net/note/delete/85478/non-english
Del: in docs -- https://master.php.net/note/delete/85478/in+docs
Del: other reasons-- https://master.php.net/note/delete/85478
Reject -- https://master.php.net/note/reject/85478
Search -- https://master.php.net/manage/user-notes.php