title: How do I Sort a Multidimensional Array in PHP
body: <p>I have CSV data loaded into a multidimensional array. In this way each "row" is a record and each "column" contains the same type of data.  I am using the function below to load my CSV file.</p>
  
  <pre><code>function f_parse_csv($file, $longest, $delimiter)
  {
    $mdarray = array();
    $file    = fopen($file, "r");
    while ($line = fgetcsv($file, $longest, $delimiter))
    {
      array_push($mdarray, $line);
    }
    fclose($file);
    return $mdarray;
  }
  </code></pre>
  
  <p>I need to be able to specify a column to sort so that it rearranges the rows.  One of the columns contains date information in the format of <code>Y-m-d H:i:s</code> and I would like to be able to sort with the most recent date being the first row.</p>