Home >Backend Development >PHP Tutorial >How to capitalize the first letter of a string and the first letter of a word in PHP_PHP Tutorial

How to capitalize the first letter of a string and the first letter of a word in PHP_PHP Tutorial

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

How to capitalize the first letter of a string and the first letter of a word in php

This article describes how to capitalize the first letter of a string and the first letter of a word in php. 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.

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

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/969343.htmlTechArticleHow to capitalize the first letter of a string and the first letter of a word in php. This article explains how to capitalize the first letter of a string in php. Capitalization and the method of capitalizing the first letter of a word. Share it with everyone for your reference...
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