php-sort-multi-dimensional-array

Php sort multi dimensional array

Long not post, and now I want post again about how to sort multi dimensional array. Example I’ve array like this:

$arr = [
	[
	'title' => 'Tree',
        'num' => 3
	],
	[
		'title' => 'Four',
        'num' => 4
	],
	[
		'title' => 'One',
        'num' => 1
	],
	[
		'title' => 'Two',
        'num' => 2
	]
];
echo "<pre>";
print_r($arr);
echo "</pre>";

And if I run this code, the result is:
(more…)

Advertisements