title: PHP - Sorting an array of data rows by price, date ASC, DESC, etc
body: <p>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:</p>
  
  <pre><code>$data[0] = array(
                   'id' =&gt; '2',
                   'price' =&gt; '400.00',
                   'date' =&gt; '2012-05-21',
                   ),
  $data[1] = array(
                   'id' =&gt; '4',
                   'price' =&gt; '660.00',
                   'date' =&gt; '2012-02-21',
                   ),
  $data[2] = array(
                   'id' =&gt; '8',
                   'price' =&gt; '690.00',
                   'date' =&gt; '2012-01-21',
                   )
  </code></pre>
  
  <p>etc..................</p>
  
  <p>How can I sort this variable based on a select box such as sort by price ASC/DESC and date ASC/DESC</p>
  
  <p>Sorry if this is simple - I am just so used to doing it via SQL that my mind has gone blank in this case.</p>