php ucfirst() function
Translation results:
UK[fɜ:st] US[fɜ:rst]
n. First, first; first class; number one,; [music] treble part
adv. first time; earliest , initially; rather; priority
adj. First-class; initial, earliest; basic, summary; high-pitched
num. First
plural: firsts
php ucfirst() functionsyntax
Function: Capitalize the first letter of the string
Syntax: ucfirst(string)
Parameters:
Parameter | Description |
string | Required, specifies the characters to be converted String |
Description: Convert the first character in the string to uppercase.
php ucfirst() functionexample
<?php $i = "hello world"; $j = ucfirst($i); echo $j; ?>
Run instance»
Click the "Run instance" button to view the online instance
Output:
Hello world
<?php echo ucfirst("hi php.cn"); ?>
Run Instance»
Click the "Run Instance" button to view the online instance
Output:
Hi php.cn