PHP ucfirst() 函数

PHP 教程 · 2019-01-30 14:42:03

实例

把 "hello" 的首字符转换为大写:

<?php
echo ucfirst("hello world!");
?>

定义和用法

ucfirst() 函数把字符串中的首字符转换为大写。

相关函数:

  • lcfirst() - 把字符串中的首字符转换为小写
  • ucwords() - 把字符串中每个单词的首字符转换为大写
  • strtoupper() - 把字符串转换为大写
  • strtolower() - 把字符串转换为小写

语法


ucfirst(string)


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

技术细节

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

点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html

查看所有标签

Prometheus: Up & Running

Prometheus: Up & Running

Brian Brazil / O'Reilly Media / 2018-7-9 / USD 49.99

Get up to speed with Prometheus, the metrics-based monitoring system used by tens of thousands of organizations in production. This practical guide provides application developers, sysadmins, and DevO......一起来看看 《Prometheus: Up & Running》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

在线进制转换器
在线进制转换器

各进制数互转换器

URL 编码/解码
URL 编码/解码

URL 编码/解码