How can multidimensional arrays be sorted in PHP based on a specific field value?

To sort multidimensional arrays in PHP based on a specific field value, you can use the `array_multisort()` function along with a custom comparison function. This function allows you to specify the field you want to sort by and the sorting order (ascending or descending).

// Sample multidimensional array
$data = [
    ['name' => 'John', 'age' => 30],
    ['name' => 'Jane', 'age' => 25],
    ['name' => 'Alice', 'age' => 35]
];

// Sort the array based on the 'age' field in ascending order
array_multisort(array_column($data, 'age'), SORT_ASC, $data);

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