Jump to content

[SOLVED] Sort by index


waynew

Recommended Posts

Ok, this is another question altogether.

 

I have a messed up array.

Array ( [0] => 1151.519 [6] => 24345.6248 [5] => 186.456 [1] => 8177.1744 [4] => 10674.6675 [2] => 16434.037 [3] => 29104.1746 [7] => 5935.786 [8] => 10403.2978 [9] => 4444.859 )

 

How can I sort that array so that the indexes go from 1 to 9? Not jumbled?

Link to comment
https://forums.phpfreaks.com/topic/114654-solved-sort-by-index/
Share on other sites

http://php.net/sort

 

 

And did you trying finding this on your own at all before posting? Try searching the web at least once before asking a common question like this. Googling 'php array sort' would get you to the above page too....

http://www.google.com/search?q=php+array+sort

 

also, if you are new to PHP, try going through this: http://devzone.zend.com/node/view/id/627 it's a great resource for beginners and covers pretty much every part of PHP

Link to comment
https://forums.phpfreaks.com/topic/114654-solved-sort-by-index/#findComment-589593
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.