Reputation: 48419
Is there a function to fill arrays applying a function to a given starting value?
$now = date('Y');
$down = 5;
// 2012, 2011, 2010, 2009, 2008
$years = array_fill_func();
Upvotes: 1
Views: 60
Reputation: 227290
If you're just using numbers you can do something like this:
$now = date('Y');
$down = 5;
$years = range($now, $now-$down);
Upvotes: 0