Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $a = array(
- array("item"=>"apple", "start"=>"24-03-2018 01:00:00"),
- array(item"=>"orange", "start"=>"24-03-2018 04:00:00"),
- array(item"=>"pineapple", "start"=>"24-03-2018 03:00:00")
- );
- $currentTime = new DateTime(date('Y-m-d H:i:s'));
- foreach ($a as $b) {
- $currentTime = $currentTime->modify('+01 seconds');
- if ($currentTime >= $b['start]) {
- //start countdown and increase by every second
- }
- var_dump($b);
- }
Add Comment
Please, Sign In to add comment