I have an array
echo '<pre>';print_r($assetArray);echo '</pre>';
which results in
Array
(
[0] => Array
(
[name] =>
[id] => 1
[asset_type] => 1
[chassis_row] => 1
[chassis_col] => 1
[manufacturer] => Brocade
[model] => VDX 2730
)
[1] => Array
(
[name] =>
[id] => 2
[asset_type] => 1
[chassis_row] => 6
[chassis_col] => 1
[manufacturer] => Brocade
[model] => VDX 2730
)
[2] => Array
(
[name] =>
[id] => 1
[asset_type] => 2
[chassis_row] => 3
[chassis_col] => 1
[manufacturer] => Aculab
[model] => E1/T1 PCI
)
[3] => Array
(
[name] =>
[id] => 2
[asset_type] => 2
[chassis_row] => 8
[chassis_col] => 1
[manufacturer] => Aculab
[model] => E1/T1 PCI
)
[4] => Array
(
[name] =>
[id] => 1
[asset_type] => 4
[chassis_row] => 4
[chassis_col] => 1
[manufacturer] => 3Com
[model] => 3CB9LF10MC
)
[5] => Array
(
[name] =>
[id] => 2
[asset_type] => 4
[chassis_row] => 5
[chassis_col] => 1
[manufacturer] => Unknown
[model] => Unknown
)
[6] => Array
(
[name] =>
[id] => 3
[asset_type] => 3
[chassis_row] => 2
[chassis_col] => 1
[manufacturer] => 3Com
[model] => 3C16791C
)
[7] => Array
(
[name] =>
[id] => 4
[asset_type] => 3
[chassis_row] => 7
[chassis_col] => 1
[manufacturer] => 3Com
[model] => 3C16791C
)
[8] => Array
(
[name] =>
[id] => 2
[asset_type] => 5
[chassis_row] => 9
[chassis_col] => 1
[manufacturer] => Unknown
[model] => Unknown
)
)
I’m trying to sort the array based on 2 keys (chassis_row and chassis_col) in ascending order so the new array is
Array
(
[0] => Array
(
[name] =>
[id] => 1
[asset_type] => 1
[chassis_row] => 1
[chassis_col] => 1
[manufacturer] => Brocade
[model] => VDX 2730
)
[1] => Array
(
[name] =>
[id] => 3
[asset_type] => 3
[chassis_row] => 2
[chassis_col] => 1
[manufacturer] => 3Com
[model] => 3C16791C
)
[2] => Array
(
[name] =>
[id] => 1
[asset_type] => 2
[chassis_row] => 3
[chassis_col] => 1
[manufacturer] => Aculab
[model] => E1/T1 PCI
)
[3] => Array
(
[name] =>
[id] => 1
[asset_type] => 4
[chassis_row] => 4
[chassis_col] => 1
[manufacturer] => 3Com
[model] => 3CB9LF10MC
)
[4] => Array
(
[name] =>
[id] => 2
[asset_type] => 4
[chassis_row] => 5
[chassis_col] => 1
[manufacturer] => Unknown
[model] => Unknown
)
[5] => Array
(
[name] =>
[id] => 2
[asset_type] => 1
[chassis_row] => 6
[chassis_col] => 1
[manufacturer] => Brocade
[model] => VDX 2730
)
[6] => Array
(
[name] =>
[id] => 4
[asset_type] => 3
[chassis_row] => 7
[chassis_col] => 1
[manufacturer] => 3Com
[model] => 3C16791C
)
[7] => Array
(
[name] =>
[id] => 2
[asset_type] => 2
[chassis_row] => 8
[chassis_col] => 1
[manufacturer] => Aculab
[model] => E1/T1 PCI
)
[8] => Array
(
[name] =>
[id] => 2
[asset_type] => 5
[chassis_row] => 9
[chassis_col] => 1
[manufacturer] => Unknown
[model] => Unknown
)
)