$string = "HELLO WORLD"; $lowercaseString = Illuminate\Support\Str::lower($string); echo $lowercaseString; // outputs "hello world"
$input = ["APPLE", "BANANA", "CHERRY"]; $output = array_map('Illuminate\Support\Str::lower', $input); print_r($output); // outputs Array ( [0] => apple [1] => banana [2] => cherry )In the first example, the str_lower function is used to convert the string "HELLO WORLD" to "hello world" and then output it to the screen. In the second example, the array_map function is used to apply the str_lower function to each element in the $input array, resulting in a new array with all elements in lowercase. Therefore, the package library that this function belongs to is Illuminate\Support.