Guest User

Untitled

a guest
Mar 23rd, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. $a = array(
  2. array("item"=>"apple", "start"=>"24-03-2018 01:00:00"),
  3. array(item"=>"orange", "start"=>"24-03-2018 04:00:00"),
  4. array(item"=>"pineapple", "start"=>"24-03-2018 03:00:00")
  5. );
  6.  
  7. $currentTime = new DateTime(date('Y-m-d H:i:s'));
  8.  
  9. foreach ($a as $b) {
  10. $currentTime = $currentTime->modify('+01 seconds');
  11. if ($currentTime >= $b['start]) {
  12. //start countdown and increase by every second
  13. }
  14. var_dump($b);
  15. }
Add Comment
Please, Sign In to add comment