当前位置: 首页> 函数类别大全> strtoupper

strtoupper

将字符串转化为大写
名称:strtoupper
分类:字符串
所属语言:php
一句话介绍:把字符串转换为大写字母。

定义和用法

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

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

相关函数:

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

实例

把所有字符转换为大写:

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

亲自试一试

语法

strtoupper(string)
参数 描述
string 必需。规定要转换的字符串。
同类函数
  • 计算字符串的soundex键 soundex

    soundex

    计算字符串的soundex键
  • 设置区域设置信息 setlocale

    setlocale

    设置区域设置信息
  • 从字符串的开头和结尾去除空格(或其他字符) trim

    trim

    从字符串的开头和结尾去除空格(或其他字符
  • 获取数字格式信息 localeconv

    localeconv

    获取数字格式信息
  • 将格式化的字符串写入流 vfprintf

    vfprintf

    将格式化的字符串写入流
  • 不区分大小写的strstr stristr

    stristr

    不区分大小写的strstr
  • 返回使用 htmlspecialchars() 和 htmlentities() 后的转换表 get_html_translation_table

    get_html_translation_table

    返回使用htmlspecialchars
  • strstr的别名 strchr

    strchr

    strstr的别名