Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $locations = array(
- 3 => array("Building", 2),
- 2 => array("Area", 1),
- 0 => array("Floor", 3),
- 1 => array("City"),
- 4 => array("Room", 0),
- 13 => array("Building1", 12),
- 12 => array("Area1", 11),
- 14 => array("Room1", 10),
- 10 => array("Floor1", 13),
- 11 => array("City1")
- );
- $route = [];
- foreach ($locations as $locationKey => $locationArray) {
- if (!isset($locationArray[1])) continue;
- $nextLocation = $locations[$locationArray[1]][0];
- $route[] = $nextLocation;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement