Hey All,
I have a little script that returns a string of dates ('Y-m-d') each of which marks the end of one of thirteen 28 Day periods, and I'm having trouble converting that string of dates (dynamaicaly mind you) into an array.
I've tried variations on...
<?php
$start = strtotime("first tuesday jan 2007");
echo date('Y-m-d',$start)."\n";
$te = (28 * (3600*24));
while($x<=12){
$f += $te;
++$x;
// echo date('Y-m-d',($start+$f))."\n";
//}
$cycleYear = date('Y-m-d',($start+$f))."\n";
$array = explode (' ', $cycleYear);
}
echo '<select name="endDate">';
foreach ($array as $key => $value) {
echo "<option value=\"$key\">
$value</option>\n";
}
echo '</select>';
?>
which get's me a dropdown with a single option [2008-01-01] (should be 2007-01-28) Please, how would I go about converting $cycleYear to an array?