Skip to content

Instantly share code, notes, and snippets.

@bbatsche
Created August 19, 2014 21:00
Show Gist options
  • Save bbatsche/000984af5c19d7615057 to your computer and use it in GitHub Desktop.
Save bbatsche/000984af5c19d7615057 to your computer and use it in GitHub Desktop.
Todo List Sorting
<?php
$items = [
0 => 'first',
1 => 'second',
2 => 'third'
];
// A
asort($items);
// Z
arsort($items);
// O - Original
ksort($items);
// R - Reverse Original
krsort($items);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment