usort($array, function($a, $b) {
return strtotime($a['date']) - strtotime($b['date']);
});
Or if you don’t have PHP 5.3:
function cb($a, $b) {
return strtotime($a['date']) - strtotime($b['date']);
}
usort($array, 'cb');
Related Contents:
- How to order “zebra” array so each key has an alternate value (either 1, 0)
- How can I sort arrays and data in PHP?
- How to Sort a Multi-dimensional Array by Value
- How to sort an array of associative arrays by value of a given key in PHP?
- Sort an Array by keys based on another Array?
- Sort array of objects by object fields
- Sort multidimensional array by multiple columns
- PHP Sort a multidimensional array by element containing Y-m-d H:i:s date
- PHP Sort Array By SubArray Value
- Sorting an associative array in PHP [duplicate]
- glob() – sort array of files by last modified datetime stamp
- Find a matching or closest value in an array
- Sorting a php array of arrays by custom order
- PHP sort array by two field values [duplicate]
- Sorting a multidimensional array in PHP? [duplicate]
- Preserve key order (stable sort) when sorting with PHP’s uasort
- How do I sort a multidimensional array by one of the fields of the inner array in PHP? [duplicate]
- Group array by subarray values
- PHP array multiple sort – by value then by key?
- How to sort a date array in PHP
- Sort array of objects by one property
- How to sort a multidimensional array by a certain key?
- How to GROUP BY and SUM PHP Array? [duplicate]
- How to sort an array of UTF-8 strings?
- Sort an array by a child array’s value in PHP
- Sort a flat, associative array by numeric values, then by non-numeric keys
- PHP Get Highest Value from Array
- Group rows in an associative array of associative arrays by column value and preserve the original first level keys
- Sort an array of associative arrays by column value
- scandir() to sort by date modified
- How to sort date array in php?
- How can I sort an array of UTF-8 strings in PHP?
- Recursively sort keys of a multidimensional array
- Using usort in php with a class private function
- Isolate comma-separated values, remove duplicates and empty values, then sort
- Sort Object in PHP [duplicate]
- Sort multidimensional array by date column, then use other column values if dates are the same
- How to sort an array of arrays in php?
- Sort array by value alphabetically php
- Custom key-sort a flat associative based on another array
- How to check if PHP array is associative or sequential?
- How to filter a two dimensional array by value
- How to insert element into arrays at specific position?
- PHP Difference between array() and []
- More concise way to check to see if an array contains only numbers (integers)
- PHP Objects vs Arrays — Performance comparison while iterating
- PHP Random Shuffle Array Maintaining Key => Value
- How to check if a specific value exists at a specific key in any subarray of a multidimensional array?
- Convert delimited string into array key path and assign value
- Split array into a specific number of chunks