Php Multiarray Sort – php de çoklu Dizi Sıralama

Php Multiarray Sort – php de  çoklu Dizi Sıralama

<?php
$people=array();

$people[0][‘id’] = 1;
$people[0][‘name’] = “Dave”;
$people[1][‘id’] = 2;
$people[1][‘name’] = “Alex”;
$people[2][‘id’] = 3;
$people[2][‘name’] = “Chris”;

function cmp($a, $b)
{
return strcmp($a[‘name’], $b[‘name’]);
}
usort($people, “cmp”);
print_r($people);

?>

Bana Ders Anlat © 2008-2022