<?php
//Array com os horarios que possam ser imprimidos
$hora = array('13:55:40','13:56:40','13:58:41','13:59:40','14:01:00','14:02:00','14:04:40', '14:05:00','14:07:10','14:08:00','14:10:23','14:11:23','14:13:39','14:14:23','14:16:39',
'14:17:23','14:19:13','14:20:23','14:22:40', '14:21:23','14:25:07', '14:26:23', '14:55:40');
//Intervalo que o usuario escolherį entre 3, 15, 30 ou 60
$interval = 3;
$val1 = $hora[0];
print $val1;
//
for ($i=0;$i<(count($hora)-1);$i++) {
$val2 = $hora[$i+1];
$datetime1 = new DateTime($val1P);
$datetime2 = new DateTime($val2P);
$intervalo = $datetime1->diff($datetime2);
$result = $intervalo->format('%i');
if($result == $interval){
print ", ".$val2;
$val1P = $val2P;
}
}
PD9waHAKCi8vQXJyYXkgY29tIG9zIGhvcmFyaW9zIHF1ZSBwb3NzYW0gc2VyIGltcHJpbWlkb3MKCSRob3JhID0gYXJyYXkoJzEzOjU1OjQwJywnMTM6NTY6NDAnLCcxMzo1ODo0MScsJzEzOjU5OjQwJywnMTQ6MDE6MDAnLCcxNDowMjowMCcsJzE0OjA0OjQwJywKCScxNDowNTowMCcsJzE0OjA3OjEwJywnMTQ6MDg6MDAnLCcxNDoxMDoyMycsJzE0OjExOjIzJywnMTQ6MTM6MzknLCcxNDoxNDoyMycsJzE0OjE2OjM5JywKCScxNDoxNzoyMycsJzE0OjE5OjEzJywnMTQ6MjA6MjMnLCcxNDoyMjo0MCcsICcxNDoyMToyMycsJzE0OjI1OjA3JywgJzE0OjI2OjIzJywgJzE0OjU1OjQwJyk7CgkKCS8vSW50ZXJ2YWxvIHF1ZSBvIHVzdWFyaW8gZXNjb2xoZXLEryBlbnRyZSAzLCAxNSwgMzAgb3UgNjAKCSRpbnRlcnZhbCA9IDM7CgkKCSR2YWwxID0gJGhvcmFbMF07CgkKCXByaW50ICR2YWwxOwoJLy8KCSR2YWwxUCA9IGRhdGUoICdnOmkgYScsIHN0cnRvdGltZSgkdmFsMSkgKTsKCQoJZm9yICgk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