ksort( ) function sorts array by its keys while preserving the values
//bool ksort ( array &arr [, int options] ) $capitalcities['England'] = 'London'; $capitalcities['Wales'] = 'Cardiff'; $capitalcities['Scotland'] = 'Edinburgh'; ksort($capitalcities);