Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. $locations = array(
  2. 3 => array("Building", 2),
  3. 2 => array("Area", 1),
  4. 0 => array("Floor", 3),
  5. 1 => array("City"),
  6. 4 => array("Room", 0),
  7.  
  8. 13 => array("Building1", 12),
  9. 12 => array("Area1", 11),
  10. 14 => array("Room1", 10),
  11. 10 => array("Floor1", 13),
  12. 11 => array("City1")
  13. );
  14.  
  15. $route = [];
  16.  
  17. foreach ($locations as $locationKey => $locationArray) {
  18.  
  19. if (!isset($locationArray[1])) continue;
  20.  
  21. $nextLocation = $locations[$locationArray[1]][0];
  22. $route[] = $nextLocation;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement