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://codercto.com/courses/l/5.html

查看所有标签

Paradigms of Artificial Intelligence Programming

Paradigms of Artificial Intelligence Programming

Peter Norvig / Morgan Kaufmann / 1991-10-01 / USD 77.95

Paradigms of AI Programming is the first text to teach advanced Common Lisp techniques in the context of building major AI systems. By reconstructing authentic, complex AI programs using state-of-the-......一起来看看 《Paradigms of Artificial Intelligence Programming》 这本书的介绍吧!

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具