Home  >  Article  >  Backend Development  >  How to use php strtoupper function?

How to use php strtoupper function?

藏色散人
藏色散人Original
2019-05-29 16:09:033551browse

php The strtoupper function is used to convert a string to uppercase. Its syntax is strtoupper(string). The parameter string is required and refers to the string to be converted.

How to use php strtoupper function?

php How to use strtoupper function?

Definition and usage

strtoupper() function converts a string to uppercase.

Note: This function is binary safe.

Related functions:

lcfirst() - Convert the first character in the string to lowercase

strtolower() - Convert the string to lowercase

ucfirst() - Converts the first character in the string to uppercase

ucwords() - Converts the first character of each word in the string to uppercase

Syntax

strtoupper(string)

Parameters

string Required. Specifies the string to be converted.

Return value: Returns the string converted to uppercase.

PHP Version: 4

Example

Convert all characters to uppercase:

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

Output:

HELLO WORLD!

The above is the detailed content of How to use php strtoupper function?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn