Latest web development tutorials

PHP strtoupper () function

PHP String Reference PHP String Reference

Examples

All the characters are converted to uppercase:

<?php
echo strtoupper("Hello WORLD!");
?>

Running instance »

Definition and Usage

strtoupper () function to convert a string to uppercase.

Note: This function is binary safe.

Related functions:

  • strtolower () - convert string to lowercase
  • lcfirst () - the first character of the string converted to lowercase
  • ucfirst () - the first character of the string to uppercase
  • ucwords () - the first character of each word in a string to uppercase

grammar

strtoupper( string )

参数 描述
string 必需。规定要转换的字符串。

technical details

return value: Returns a string converted to uppercase.
PHP version: 4+


PHP String Reference PHP String Reference