php把字符串转换为大写的方法
发布时间:2020-08-28 09:25:47
来源:亿速云
阅读:57
作者:小新
小编给大家分享一下php把字符串转换为大写的方法,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!php把字符串转换为大写的方法:可以利用内置函数strtoupper()来进行转换。strtoupper()函数可以把指定的字符串转换为大写,并返回被转换为大写的字符串。
使用函数:
strtoupper() 函数把字符串转换为大写,并返回转换为大写的字符串。
语法:strtoupper(string)
(相关推荐:php培训)
代码实现:<?php
$string = "Learn PHP string functions at phpcn";
$lower = strtolower($string);
$upper = strtoupper($string);
print("$lower\n");
print("$upper\n");
print("\n");
?>
输出结果:learn php string functions at phpcn
LEARN PHP STRING FUNCTIONS AT PHPCN
以上是php把字符串转换为大写的方法的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!