Jump to content

array_reverse doesnot work


sandy1028

Recommended Posts

Hi,

 

I have the code below and I have the output in reverse order but if I use array_reverse($time_interval) it is not working Please help me

 

list($year,$day,$month,$hour,$minute,$second) = explode(':', date('Y:m:d:H:i:s'));

$minute = 60*(floor($minute/60));

$time_interval = array();
for($minutes=0; $minutes<=24*60; $minutes += 60)
{
    $ti = date('H:i', mktime($hour,$minute-$minutes,$second,$month,$day,$year));

//array_reverse($time_interval);
array_push($time_interval,$ti);
//array_reverse($time_interval);

}

array_pop($time_interval);
for($i=0;$i<count($time_interval);$i++){
print $time_interval[$i]."\n";
}



Link to comment
https://forums.phpfreaks.com/topic/93622-array_reverse-doesnot-work/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.