hello ,
i want to fill an array with numbers depending on a variable.
on the page for holiday booking, the user gives the date of arrival and the date of departure,
now i have written code to determine the number of days the user is staying.
say this is 5
now i want to fill a variable with the numbers 1,2,3,4,5
if the user stays 3 days the variable should be filled with 1,2,3
i came up with this
$muliplier = dateDiff("/", $date2, $date1);
$i=1;
while ($i < $muliplier) {
$a = array($i => $i);
$i++;
}
print $a;
but this doenst seem to work.. anyone?