How can a multidimensional array be sorted in PHP based on a specific column?

To sort a multidimensional array in PHP based on a specific column, you can use the `array_multisort()` function. This function allows you to sort multiple arrays or a multidimensional array based on one or more columns. You need to extract the column you want to sort by into a separate array, sort that array, and then use the sorted keys to reorder the original multidimensional array.

<?php
// Sample multidimensional array
$data = array(
    array('name' => 'John', 'age' => 30),
    array('name' => 'Alice', 'age' => 25),
    array('name' => 'Bob', 'age' => 35)
);

// Extract the column you want to sort by
foreach ($data as $key => $row) {
    $column[$key] = $row['age'];
}

// Sort the extracted column
array_multisort($column, SORT_ASC, $data);

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