php ucfirst函数用于字符串首字母大写,ucfirst语法是ucfirst(string),参数string是必须的,规定要转换的字符串。
php ucfirst函数怎么用?
作用:字符串首字母大写
语法:
ucfirst(string)
参数:
立即学习“PHP免费学习笔记(深入)”;
string 必须,规定要转换的字符串。
说明:把字符串中的首字符转换为大写。
php ucfirst()函数使用示例1
<?php $i = "hello world"; $j = ucfirst($i); echo $j; ?>
输出:
Hello world
php ucfirst()函数使用示例2
<?php echo ucfirst("hi php.cn"); ?>
输出:
Hi php.cn
以上就是php ucfirst函数怎么用的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号