I would return ``$b['index'] - $a['index']`` here, so that you handle equal indexes properly (PHP does not need 1 or -1 but simply positive or negative).