You can use the ucwords() function. It converts the first character of each word in a string to uppercase.
Here is an example:
<?php$str = "hello brother, how are you?";echo ucwords($str);?>
The above code will return the following output:
Hello Brother, How Are You?