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() function syntax

Function: Capitalize the first letter of the string

Syntax: ucfirst(string)

Parameters:

ParameterDescription
stringRequired, specifies the characters to be converted String

Description: Convert the first character in the string to uppercase.

php ucfirst() function example

<?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