$arr = [
'foo' => 'bar',
'faz' => 'baz'
];
array_multisort(array_column($arr, 'value'), SORT_ASC, $arr);
You can sort an associative array with one line of code as I did above. As a result, the array becomes sorted by the keys:
[
'faz' => 'baz',
'foo' => 'bar'
]