- print_r: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
- range: documentation ( source)
<?php
$year = date("Y");
$yearDoubleBack = date("Y", strtotime($year . " - 2 year"));
$YearDoubleAhead = date("Y", strtotime($year . " + 2 year"));
echo '$yearDoubleBack => ' . $yearDoubleBack;
echo PHP_EOL;
echo '$YearDoubleAhead => ' . $YearDoubleAhead;
echo PHP_EOL;
$years = range($yearDoubleBack, $YearDoubleAhead);
print_r($years);