It's not tested but I think this will do what you need:
// first create a new array of just the order numbers
// in the same order as the original array
$orders_index = array();
foreach( $pickup1_dropoff1Items as $item ) {
$orders_index[] = $item[4];
}
// then use a sort of the orders array to sort the original
// array at the same time (without needing to look at the
// contents of the original)
array_multisort( $orders_index, $pickup1_dropoff1Items );
This is essentially example 1 here:
http://www.php.net/manual/en/function.array-multisort.php
but our $ar2
is an array of arrays instead of an array of single values. Also if you need more control over the sort you'll see examples of options you can use at that URL: just add them to the list of arguments for array_multisort
.