$arr = array();
foreach ($old_arr as $key => $item) {
$arr[$item['id']][$key] = $item;
}
ksort($arr, SORT_NUMERIC);
More Related Contents:
- Preserve key order (stable sort) when sorting with PHP’s uasort
- How to get popular keywords in an array
- 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 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
- List of Big-O for PHP functions
- PHP Sort Array By SubArray Value
- Sorting a php array of arrays by custom order
- String with array structure to Array [duplicate]
- How to sort a multidimensional array by a certain key?
- How to sort a date array in PHP
- Combinations, Dispositions and Permutations in PHP
- How to sort an array of UTF-8 strings?
- PHP Sort array by field? [duplicate]
- How to sort an array of arrays in php?
- Sort Object in PHP
- Algorithm to get all possible string combinations from array up to certain length
- Sort multidimensional array by date column, then use other column values if dates are the same
- Grouping arrays in PHP
- Group rows in an associative array of associative arrays by column value and preserve the original first level keys
- Recursively sort keys of a multidimensional array
- Sort an array of associative arrays by column value
- Sort array by value alphabetically php
- How to have a stable sort in PHP with arsort()?
- how to sort a multidemensional array by an inner key
- How do I move an array element with a known key to the end of an array in PHP?
- Sort array by numeric keys