3v4l.org

run code in 300+ PHP versions simultaneously
<?php $locations = Array( Array ( 'id' => 14, 'post_id' => 319, 'location' => 'Atlanta, GA', 'address' => '161 Racetrack Rd., McDonough', 'city' => 'Atlanta', 'state' => 'Georgia', 'state_code' =>'GA', 'country' => 'USA', 'zipcode' => 30253, 'service_zipcode' => '', 'phone' => '', 'fax' => '', 'email' => '', 'facebook' => '', 'twitter' => '', 'linkedin' => '', 'gplus' => '', 'latitude' => '', 'longitude' => '', 'url' => '', 'created_at' => '2019-04-22 07:22:55', 'updated_at' => '2019-04-22 07:26:31', ), Array ( 'id' => 16, 'post_id' => 321, 'location' => 'Augusta, Georigia', 'address' => '1446 Harper Street', 'city' => 'Augusta', 'state' => 'Georigia', 'state_code' => 'GA', 'country' => 'USA', 'zipcode' => '', 'service_zipcode' => '', 'phone' => '', 'fax' => '', 'email' => '', 'facebook' => '', 'twitter' => '', 'linkedin' => '', 'gplus' => '', 'latitude' => '', 'longitude' => '', 'url' => '', 'created_at' => '2019-04-22 07:29:33', 'updated_at' => '2019-04-22 07:32:25', ), Array ( 'id' => 12, 'post_id' => 317, 'location' => 'Savannah, Georgia', 'address' => '834 Northside Dr. East, Statesboro', 'city' => 'Savannah', 'state' => 'Georgia', 'state_code' => 'GA', 'country' => 'USA', 'zipcode' => 30458, 'service_zipcode' => '', 'phone' => '', 'fax' => '', 'email' => '', 'facebook' => '', 'twitter' => '', 'linkedin' => '', 'gplus' => '', 'latitude' => '', 'longitude' => '', 'url' => '', 'created_at' => '2019-04-22 07:15:43', 'updated_at' => '2019-04-22 07:18:11', ) ); $hierarchy = []; if (! empty($locations)) { foreach ($locations as $location) { $hierarchy[$location['country']][$location['state']] = $location; } } if (! empty($hierarchy)) { foreach ($hierarchy as $country => $location) { echo "<br/>" . $country; if (! empty($hierarchy[$country])) { foreach ($hierarchy[$country] as $state => $city) { echo "<br/>--> " . $state; echo "<br/>----> " . $city['city']; } } } }
Output for git.master, git.master_jit, rfc.property-hooks
<br/>USA<br/>--> Georgia<br/>----> Savannah<br/>--> Georigia<br/>----> Augusta

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
57.45 ms | 401 KiB | 8 Q