$hours = date('H');
$minutes = (integer) date('i');
// round down to the nearest multiple of 5
$minutes = floor($minutes / 5 ) * 5 - 5;
// if $minutes is 0 or 5 we add a trailing 0
if($minutes < 10) {
$minutes = '0' . $minutes;
}
$date = date("dmY");
#Variablen maken voor 60 minuten radar loop
$a = 'ref_' . $date . $hours . ($minutes - 55 ) . '.png';
$b = 'ref_' . $date . $hours . ($minutes - 50 ) . '.png';
$c = 'ref_' . $date . $hours . ($minutes - 45 ) . '.png';
$d = 'ref_' . $date . $hours . ($minutes - 40 ) . '.png';
$e = 'ref_' . $date . $hours . ($minutes - 35 ) . '.png';
$f = 'ref_' . $date . $hours . ($minutes - 30 ) . '.png';
$g = 'ref_' . $date . $hours . ($minutes - 25 ) . '.png';
$h = 'ref_' . $date . $hours . ($minutes - 20 ) . '.png';
$i = 'ref_' . $date . $hours . ($minutes - 15 ) . '.png';
$j = 'ref_' . $date . $hours . ($minutes - 10 ) . '.png';
$k = 'ref_' . $date . $hours . ($minutes - 5 ) . '.png';
$l = 'ref_' . $date . $hours . $minutes . '.png';
print $a .'<br />' . $b .'<br />' . $c .'<br />' . $d .'<br />' . $e .'<br />' . $f .'<br />' . $g .'<br />' . $h .'<br />' . $i .'<br />' . $j .'<br />' . $k .'<br />' . $l;
This outputs:
ref_0604201422-50.png
ref_0604201422-45.png
ref_0604201422-40.png
ref_0604201422-35.png
ref_0604201422-30.png
ref_0604201422-25.png
ref_0604201422-20.png
ref_0604201422-15.png
ref_0604201422-10.png
ref_0604201422-5.png
ref_06042014220.png
ref_060420142205.png
It should output:
ref_060420142110.png
ref_060420142115.png
ref_060420142120.png
ref_060420142125.png
ref_060420142130.png
ref_060420142135.png
ref_060420142140.png
ref_060420142145.png
ref_060420142150.png
ref_060420142155.png
ref_060420142200.png
ref_060420142205.png
thank you!