Converting the first letter to upper case of every wordWe can use php string function ucwords to change all first character of words present in a string to upper case or capitalize the first letter of each word.
Here is the syntax
$output=ucwords($input_str);You can see the output string is $output and input string is $input_str in the above example.
Now let us try with one example
Here is a string variable $str with some string inside it. We will use ucwords to capitalize first chars of every words inside it.
$str="welcome to plus2net.com. you can learn web programming here";
The output is here