Home > Backend Development > PHP Tutorial > PHP strtoupper函数有什么用

PHP strtoupper函数有什么用

PHPz
Release: 2020-09-04 17:44:32
Original
3069 people have browsed it

PHP strtoupper是PHP中的一个内置函数,作用是将字符串中的所有字符转换为大写,该函数的语法是“strtoupper(string)”,返回值是转换为大写的字符串。

PHP strtoupper函数有什么用

PHP strtoupper函数有什么用?

strtoupper() 函数把字符串转换为大写。

注释:该函数是二进制安全的。

语法

strtoupper(string)
Copy after login

参数:

  • string:必需。规定要转换的字符串。

返回值: 返回转换为大写的字符串。

示例:

<?php
$i = "hello world";
$j = strtoupper($i);
echo $j;
?>
Copy after login

输出:

HELLO WORLD
Copy after login

扩展:相关函数

  • strtolower() - 把字符串转换为小写

  • lcfirst() - 把字符串中的首字符转换为小写

  • ucfirst() - 把字符串中的首字符转换为大写

  • ucwords() - 把字符串中每个单词的首字符转换为大写

更多相关知识,请访问 PHP中文网!!

Related labels:
Statement of this Website
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template