note 85702 modified in function.strtotime by felipe

From: Date: Sat, 13 Sep 2008 00:39:41 +0000
Subject: note 85702 modified in function.strtotime by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-144387@lists.php.net to get a copy of this message
I'm find some simple way to find all days between a couple of dates (Все дни между двумя датами): <?php $dt=Array("27.01.1985","12.09.2008"); $dates=Array(); $i=0; while (strtotime($dt[1])>=strtotime("+".$i." day",strtotime($dt[0]))) $dates[]=date("Y-m-d",strtotime("+".$i++." day",strtotime($dt[0]))); foreach ($dates as $value) echo $value."<br />"; ?> --was-- I'm find some simple way to find all days between a couple of dates (Все дни между двумя датами): $dt=Array("27.01.1985","12.09.2008"); $dates=Array(); $i=0; while (strtotime($dt[1])>=strtotime("+".$i." day",strtotime($dt[0]))) $dates[]=date("Y-m-d",strtotime("+".$i++." day",strtotime($dt[0]))); foreach ($dates as $value) echo $value."<br />"; http://php.net/manual/en/function.strtotime.php

« previous php.notes (#144387) next »