$string = "HELLO WORLD!"; $lowercase_string = strtolower($string); echo $lowercase_string; // Output: hello world!
// Sample array of strings $names = array("John", "DOE", "Kate"); // Convert all array elements to lowercase using strtolower() $lowercase_names = array_map('strtolower', $names); // Output: Array ( [0] => john [1] => doe [2] => kate ) print_r($lowercase_names);In this example, the array_map() function is used to convert all elements of the array "$names" to lowercase using strtolower(). Package/library: PHP Core Library