您的位置 首页 php

php ucwords函数怎么用

php ucwords函数用于把每个单词的首字符转换为大写,其语法是ucwords(string),参数string是必须的,是规定要转换的字符串。

php ucwords函数怎么用?

作用:把每个单词的首字符转换为大写

语法:

ucwords(string)

参数:

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

说明:把字符串中每个单词的首字符转换为大写,该函数是二进制安全的。

php ucwords()函数使用示例1:

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

输出:

Hello World

php ucwords()函数使用示例2:

<?php$i = "I'm study in php.cn";$j = ucwords($i);echo $j;?>

输出:

I'm Study In Php.cn

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

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

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

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

关于作者: 智云科技

热门文章

网站地图