62 of 410 menu

The strtoupper Function

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

Syntax

strtoupper(string $string): string

Example

Let's convert a string to uppercase:

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

Code execution result:

'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
byenru