I have used the following code to display the previous and after years of current year.
<?php
$year = date(Y);
$endyear = $year + 10;
$startyear = $year - 10;
for ($i = $startyear; $i <= $endyear; $i++)
{
echo $i;
}
?>
I want to put the resulting values of $i in an array. How can I do that?
check array using
print_r($arr);