what is the syntax of the UCWORDS() function in php?
ucwords(string, delimiters)
Parameter | Description |
---|---|
string | Required. Specifies the string to convert |
delimiters | Optional. Specifies the word separator character |
examples of the UCWORDS() function
Example 1. In this example, we convert the first character of each word to uppercase.
<?php
echo ucwords("hello world");
?>
Example 2. In this example, we convert the first character of each word to uppercase, with a custom word separator added.
<?php
echo ucwords("hello|world", "|");
?>