- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
ucwords() function in PHP
The ucwords() function is used to convert the first character of a string to uppercase in each string.
Syntax
ucwords(str)
Parameters
str − The specified string
Return
The ucfirst() function returns the converted string.
Example
The following is an example −
<?php echo ucwords("This is it!"); ?>
Output
The following is the output −
This Is It!
Example
Let us see another example −
<?php $s = "#demo#text"; $sep = '$'; $res = ucwords($s, $sep); print_r($res); ?>
Output
The following is the output −
#demo#text
Advertisements