PHP - Sorting an array of data rows by price, date ASC, DESC, etc

bsandler

New Member
I have an array of data which contains associative array rows and I would like to sort them by price,date etc. This cannot be done via SQL as these values are not in a database - I simply have a large array with the following example data:\[code\]$data[0] = array( 'id' => '2', 'price' => '400.00', 'date' => '2012-05-21', ),$data[1] = array( 'id' => '4', 'price' => '660.00', 'date' => '2012-02-21', ),$data[2] = array( 'id' => '8', 'price' => '690.00', 'date' => '2012-01-21', )\[/code\]etc..................How can I sort this variable based on a select box such as sort by price ASC/DESC and date ASC/DESCSorry if this is simple - I am just so used to doing it via SQL that my mind has gone blank in this case.
 
Back
Top