ucfirst() function capitalizes the first letter of a string. : ucfirst « String « PHP






ucfirst() function capitalizes the first letter of a string.

 
Its syntax is: string ucfirst (string string)

<?
$sentence = "cooking";
$sentence = ucfirst($sentence);
print $sentence;
?>
  
  








Related examples in the same category

1.Capitalizing letters
2.ucfirst.php
3.string ucfirst ( string str ) converts the first letter of the string to an uppercase character