Home > php教程 > php手册 > php ucwords() 函数将字符串中每个单词的首字符转换为大写(实现代码),ucwords大写

php ucwords() 函数将字符串中每个单词的首字符转换为大写(实现代码),ucwords大写

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 08:40:17
Original
829 people have browsed it

php ucwords() 函数将字符串中每个单词的首字符转换为大写(实现代码),ucwords大写

php ucwords() 函数将字符串中每个单词的首字符转换为大写, 本文章向码农介绍php ucwords() 函数的基本使用方法和实例,感兴趣的码农可以参考一下。

定义和用法

ucwords() 函数把字符串中每个单词的首字符转换为大写。

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

相关函数:

  • lcfirst() - 把字符串中的首字符转换为小写
  • strtolower() - 把字符串转换为小写
  • strtoupper() - 把字符串转换为大写
  • ucfirst() - 把字符串中的首字符转换为大写

语法 ucwords(string)

参数 描述
string 必需。规定要转换的字符串。

技术细节

返回值: 返回已转换的字符串。
PHP 版本: 4+

实例

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

以上这篇php ucwords() 函数将字符串中每个单词的首字符转换为大写(实现代码)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持帮客之家。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template