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

To sort a multidimensional array in PHP based on a specific key value, you can use the `array_multisort()` function along with a custom sorting function. This function allows you to specify the key you want to sort by and the sorting order (ascending or descending). By using this function, you can easily rearrange the elements of the multidimensional array based on the specified key value.

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

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

// Print the sorted array
print_r($array);