Current Location: Home> Function Categories> ucfirst

ucfirst

Set the first character of the string to uppercase
Name:ucfirst
Category:String
Programming Language:php
One-line Description:Converts the first character in the string to uppercase.

Definition and usage

ucfirst() function converts the first character in the string to uppercase.

Related functions:

  • lcfirst() - Convert first character in a string to lowercase
  • strtolower() - Convert strings to lowercase
  • strtoupper() - Convert string to uppercase
  • ucwords() - Convert the first character of each word in a string to uppercase

Example

Convert the first character of "hello" to uppercase:

 <?php
echo ucfirst ( "hello world!" ) ;
?>

Try it yourself

grammar

 ucfirst( string )
parameter describe
string Required. Specifies the string to be converted.
Similar Functions
Popular Articles