Jump to content

Sort array alphabeticaly


EagerWolf

Recommended Posts

I am trying to sort array alphabetically ...

 

But I have a problem..

 

$array = array(
'1' => 'a',
'2' => 'c',
'3' => 'b'
);

 

When I sort this array I get this:

 


[code]
$array = array(
'1' => 'a',
'2' => 'b',
'3' => 'c'
);

 

But I want to get this:


[code]
$array = array(
'1' => 'a',
'3' => 'b',
'2' => 'c'
);

 

I want key words to be sorted as well ...

 

Thanks for your help![/code][/code]

Link to comment
https://forums.phpfreaks.com/topic/50629-sort-array-alphabeticaly/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.