I can not show the sequence element of an Array with schedules.
I created a $ hour variable that stores the local time, and an array with several times $ os, so I search for an equal time, if it has it, but if it does not, I want to show the next time.
Look what I've done:
$hora = date('Hi');
$os = array('1632','1635','1638','1654','1642');
if( in_array($hora, $os)){
echo "Proximo onibus as : " . $hora;
}else{
echo // Comparar e dar o valor subsequente ao valor da hora
// encontrada
}
};
Any suggestions?