Home >Backend Development >PHP Tutorial >PHP method to capitalize the first letter of a string and the first letter of a word, string capitalization_PHP tutorial

PHP method to capitalize the first letter of a string and the first letter of a word, string capitalization_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:03:49896browse

How to capitalize the first letter of a string and the first letter of a word in PHP. String capitalization

This article describes how to capitalize the first letter of a string and the first letter of a word in PHP. method. Share it with everyone for your reference. The specific analysis is as follows:

ucfirst can capitalize the first letter of the string, and ucwords can capitalize the first letter of each word in the string.

<&#63;php
print ucfirst("hello world");
print ucwords("iam king of the jungle");
&#63;>

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/967734.htmlTechArticlephp method to capitalize the first letter of a string and the first letter of a word, string capitalization This article describes the php implementation Methods to capitalize the first letter of a string and the first letter of a word. Share to...
Statement:
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