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

To sort a multidimensional array based on specific criteria in PHP, you can use the `usort()` function along with a custom comparison function. This comparison function should define the sorting criteria based on the values of the elements being compared. By using `usort()` and providing a custom comparison function, you can sort the multidimensional array according to your specific requirements.

// Sample multidimensional array
$students = array(
    array('name' => 'Alice', 'age' => 20),
    array('name' => 'Bob', 'age' => 22),
    array('name' => 'Charlie', 'age' => 18)
);

// Custom comparison function to sort based on age
usort($students, function($a, $b) {
    return $a['age'] - $b['age'];
});

// Print sorted array
print_r($students);