If I understand correctly you have two arrays with the same amount of elements, which must be compared on the basis of their index, to determine whether the former has a value greater than the latter.
Let us exemplify:
// Array com as horas iniciais
$arrayHoraInicial = array(
'09:32:00',
'11:20:10',
'13:06:55',
'19:10:10',
);
// Array com as horas finais
$arrayHoraFinal = array(
'09:50:00',
'12:10:00',
'12:25:15',
'21:11:08',
);
// Captura quantos elementos existem no array.
$quantidade = count($arrayHoraInicial);
// Realiza um loop for para percorrer os arrays.
for ($i = 0; $i < $quantidade; $i++) {
// Compara horas string
if($arrayHoraFinal[$i] < $arrayHoraInicial[$i]) {
echo "O índice $i apresenta um valor final maior que o inicial";
}
}
In the above example the printed result will be:
Index 2 shows a final value greater than the initial
presents these arrays and an example of the desired result
– user60252
http://php.net/manual/en/function.array-diff.php
– Rafael Augusto
Hora_ini | Hora_fim<br> 0110000 | 0080000<br> 1130000 | 1140000<br> As you can see on line 1 has a value that is higher at Start Time, I need to know how to check line by line and display an error message. In case the line 1 has an error, because the Initial time is greater than the Final Hora_time
– Luis Renato H. Jr.
That’s not a
array
, you are reading this line and converting?– Marcelo de Andrade
Here I formatted. I have the two variables that are with the array values. $dtINI ; $dtFIM in them so stored the values.
– Luis Renato H. Jr.
You can put Start Time and End Time as an example of data in your question?
– novic