Search code examples
phpmysqlarrayssortingmicrotime

Sort php/mysql microstime


what is the shortest and most beautiful way to sort an microtime value, which is importet from a mysql database, with php that the latest date/time is on the top or the first value of an array. Thanks


Solution

  • Read up on the SQL ORDER BY clause, essentially you do SELECT .. FROM .. ORDER BY mycolumn to do what you're looking to do.