Capitalize first character of each word in a string with ucwords function

You can convert first character in upper case of each word in a string with using ucwords function. This function takes once argument. The example of ucwords function is mentioned below: Code


<?php
  $greetingStr = "good morning";
  $result = ucwords($greetingStr);
  echo $result;
?>