Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $listSort[] = array('email' => 'a@b.c', 'name' => 'x', 'umur' => 21);
- $listSort[] = array('email' => 'a2@b.c', 'name' => 'y', 'umur' => 11);
- $listSort[] = array('email' => 'a3@b.c', 'name' => 'z', 'umur' => 33);
- foreach ($listSort as $key => $row) {
- $name2[$key] = $row['name'];
- $umur2[$key] = $row['umur'];
- }
- array_multisort($umur2, SORT_DESC, $name2, SORT_ASC, $listSort);
- echo '<pre>';
- echo print_r($listSort);
- echo '</pre>';
Add Comment
Please, Sign In to add comment