Jump to content

Array sorting.


mikembley

Recommended Posts

Im Ok with PHP but as i am learning i find it is sometimes hard to find the things you want to know, So i came here Smile

 

//Array held in $aData

Array
(
    [0] => Array
        (
            [0] => 817
            [1] =>  5.6" Venus TFT Photo Player White - PhotoMP3VideoGameClock SDCF Flash with USB2 & Remote 
            [2] => 63.43
            [3] => Takes Care of all your Photo's - MP3 - Display Clock - Slide Show - Voice Recorder
            [4] => 1
            [5] => 817
            [6] =>

            [iFindAll] => 252
        )

    [1] => Array
        (
            [0] => 818
            [1] => 7" Scan Widescreen Pframe USB2 MP4321 DiVX Remote & All in 1 Flash card Reader TVOut Audio Out
            [2] => 66.60
            [3] => Ideal for the Home - Show all your photo's! - The Quick & Easy way to view and share uour pictures instantly.
            [4] => 1
            [5] => 818
            [6] =>
        )

    [2] => Array
        (
            [0] => 819
            [1] =>  7" ATMT MINIVIEW Widescreen Digital Photo Frame
            [2] => 80.07
            [3] => 7" TFT Active Matrix LCD
            [4] => 1
            [5] => 819
            [6] =>
        )
)

 

What i want to do is sort $aDatas arrays by price, Which would be $aData[$i][2] .

 

Ive tried multiple methods, but i cant seem to make anything of them, Hopefully someone will be able to help

 

Would this be a 2-dimensional array? Im learning as i go by.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/45538-array-sorting/
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.