English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

PHP ucwords() Function Usage and Example

PHP String 字符串函数手册

The ucwords() function is used to convert the first letter of each word in the string to uppercase.

Syntax

ucwords(string)

Definition and Usage

Convert the first letter of each word in the string to uppercase

Return Value

It returns the modified string

Parameter

NumberParameters and Description
1

string

Specify the string to be converted

Online Example

Try the following example, convert the first letter of each word to uppercase

<?php
   //Convert the first letter of each word to uppercase
   echo ucwords("can i help you?");
?>
Test and See‹/›

Output Result

Can I Help You?

PHP String 字符串函数手册