In the following code
The variable $test is uppercase. The ucwords Changes only the first letter of each word. You can't see changes and the result with the variable are same.
[1]
<?php
$test="HELLO WORLD";
echo ucwords($test);
// it will print HELLO WORLD
?>
In the second code...
All the string variable first converted to lower case with strtolower function
and then the ucwords function changes all first characters from the words as uppercase.
With strtolower the result is => "hello world"
After, the ucwords result is "Hello World".
[2]
<?php
$test="HELLO WORLD";
echo ucwords(strtolower($test));
// it will print Hello World
?>