3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $attractionsArray = array( "Services" => array( "Travel & Hotels ~72", "Automotive~119", "Professional Services~71", "Home Services~70", "IT Services & Computer Repair~83", "Health and Medical~69" ), "Restaurants" => array( "American / Eclectic~2", "Cafe~11", "Desserts & Bakery~111" ), "Shopping" => array( "Office Equipment~103", "Department Stores~91", "Cosmetics & Beauty Supply~90", "Musical Instruments & Teachers~102", "Food~87" ), "Entertainment" => array( "Bars/Pubs~48" ), "Travel" => array( "Hotels~129" ) ); foreach($attractionsArray as $key => $innerArray) { sort($innerArray, SORT_STRING); $attractionArray[$key] = $innerArray; } print_r($attractionArray);
Output for 4.3.0 - 7.1.0
Array ( [Services] => Array ( [0] => Automotive~119 [1] => Health and Medical~69 [2] => Home Services~70 [3] => IT Services & Computer Repair~83 [4] => Professional Services~71 [5] => Travel & Hotels ~72 ) [Restaurants] => Array ( [0] => American / Eclectic~2 [1] => Cafe~11 [2] => Desserts & Bakery~111 ) [Shopping] => Array ( [0] => Cosmetics & Beauty Supply~90 [1] => Department Stores~91 [2] => Food~87 [3] => Musical Instruments & Teachers~102 [4] => Office Equipment~103 ) [Entertainment] => Array ( [0] => Bars/Pubs~48 ) [Travel] => Array ( [0] => Hotels~129 ) )