I have a problem I have values in array for example: (first value is the time() value and other one is just random number)
$array = array(23333_2, 32442_40, 887378_23);
asort = array($array);
foreach ($array as $value){
$explo = explode("_", $value);
$tim = $explo['0'];
$hrac = $explo['1'];
$date = date('H', $tim);
}
So with that code i get the hour when the value was taken. And after I need to echo second values (23333_2, 32442_40, 887378_23) in the right order by time desc, I take last 24 readings from mysql and that includes few old values from the previos day, but the problem is that I dont need these "old" values from the previos day but at the same time i need exactly 24 readings, I ve tried to replace these values to 0 but unfortunately that didnt work.
if I would convert time() to hours and echo them order would be something like:
20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
So first 4 readings in that case I dont need and my question is how can i replace values to 0 that are from the previos day?