I have an array which looks like this:
$arr = ( [0]=>Int(2) [1]=>Array( ....) [2]=>Array( ....) [3]=>Array( ....))
just use uasort()
http://php.net/manual/en/function.uasort.php