The strtoupper Function

The strtoupper function converts a string to uppercase. It works correctly only with Latin characters (single-byte characters).

Syntax

phpstrtoupper(string $string): string

Example

Let's convert a string to uppercase:

php<?php
  echo strtoupper('abcde');
?>

Code execution result:

php'ABCDE'

See Also

  • the strtolower function,
    which converts a string to lowercase
  • the ucfirst function,
    which converts the first character to uppercase
  • the lcfirst function,
    which converts the first character to lowercase
  • the ucwords function,
    which converts the first letters of words to uppercase