samedi 15 novembre 2014

PHP Simple For loop only loop today's date with time function


Vote count:

0




I need to write a simple php code that decrements day by day and stop when a certain date hits (in this case yesterday). I have written following code piece to do this but this seems to be looping forever ... not stooping at the forloop break condition i set



//start time to decrements
$time = time(); // for now start with today or set with strtotime('2010-08-01 00:00:00');
for ($time = time(); $time >= ($time - (24 * 3600)); $time = ($time - (24 * 3600))) {
run("www.xyx.com",date("Y/m/d", $time));
}


Any ideas ?



asked 28 secs ago







PHP Simple For loop only loop today's date with time function

Aucun commentaire:

Enregistrer un commentaire