What are the advantages and limitations of using array_multisort in PHP for sorting arrays with complex data structures?

When sorting arrays with complex data structures in PHP, using the `array_multisort` function can be advantageous as it allows for sorting multiple arrays or multidimensional arrays based on one or more keys. This function is efficient and can handle sorting of complex data structures with ease. However, one limitation is that it requires the data to be organized in a specific way for proper sorting, which may require additional preprocessing of the data.

// Example of using array_multisort to sort a multidimensional array based on multiple keys
$data = [
    ['name' => 'John', 'age' => 30],
    ['name' => 'Jane', 'age' => 25],
    ['name' => 'Bob', 'age' => 35]
];

// Sort by age in descending order, then by name in ascending order
array_multisort(array_column($data, 'age'), SORT_DESC, array_column($data, 'name'), SORT_ASC, $data);

// Output the sorted array
print_r($data);