[Solved] sort numerical array inside associative array php January 13, 2023 by Kirat Use sort() on each array within the array. foreach ($arr as $key=>$val) { if (is_array($val)) { sort($arr[$key]); } } See demo 1 solved sort numerical array inside associative array php