Convert all string values in an array to uppercase with array_map() and strtoupper.
Source Code
$fruits = ["apple", "banana", "cherry"];
$upperFruits = array_map("strtoupper", $fruits);
print_r($upperFruits); // Outputs array with uppercase values
Convert all string values in an array to uppercase with array_map() and strtoupper.
$fruits = ["apple", "banana", "cherry"];
$upperFruits = array_map("strtoupper", $fruits);
print_r($upperFruits); // Outputs array with uppercase values