­
­
Date array sort by php – RM Web Lab

Date array sort by php

This is very simple.
but date format(Y-m-d) is very important.

<script class="brush: php" type="syntaxhighlighter">
$date = array();
$date[0] = '2011-04-10';
$date[1] = '2009-04-01';
$date[2] = '2010-01-03';
$date[3] = '2011-08-04';
arsort($date);
</script>

Leave a Reply

Your email address will not be published. Required fields are marked *