Masjid Al-Ikhlas berdiri sejak tanggal

In different situations, you may require making a string completely uppercase or lowercase or camel case letters i.e. capitalize the first letter of each word.

PHP provides built-in functions for that. The functions are listed below which is followed by examples of using them.

  • strtoupper() function– For making a PHP string uppercase (all letters in the string)
  • strtolower() function – that converts a specified string to lowercase letters.
  • ucwords() – camel cased i.e. capitalizes the first letter of each word in a string.
  • For making the first letter of a string capital, use the ucfirst() function of PHP.
  • In order to make the first letter lowercased, use the lcfirst()

The next section shows you the examples of each function with a little more details.