您的位置 首页 php

php ucfirst函数怎么用

php ucfirst函数用于字符串首字母大写,ucfirst语法是ucfirst(string),参数string是必须的,规定要转换的字符串。

php ucfirst函数怎么用?

作用:字符串首字母大写

语法:

ucfirst(string)

参数:

string必须,规定要转换的字符串。

说明:把字符串中的首字符转换为大写。

php ucfirst()函数使用示例1

<?php$i = "hello world";$j = ucfirst($i);echo $j;?>

输出:

Hello world

php ucfirst()函数使用示例2

<?phpecho ucfirst("hi php.cn");?>

输出:

Hi php.cn

以上就是php ucfirst函数怎么用的详细内容,更多请关注求知技术网其它相关文章!

文章来源:智云一二三科技

文章标题:php ucfirst函数怎么用

文章地址:https://www.zhihuclub.com/4348.shtml

关于作者: 智云科技

热门文章

网站地图