PHP/String/ucfirst

Материал из Web эксперт
Перейти к: навигация, поиск

Capitalizing letters

   <source lang="html4strict">

<?php print ucfirst("how do you do today?"); print ucwords("the prince of wales"); ?>

 </source>
   
  


string ucfirst ( string str ) converts the first letter of the string to an uppercase character

   <source lang="html4strict">

<?

   $string = "i like to program in PHP";
   $a = strtoupper($string);

?>

 </source>
   
  


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

   <source lang="html4strict">

Its syntax is: string ucfirst (string string) <? $sentence = "cooking"; $sentence = ucfirst($sentence); print $sentence; ?>

 </source>
   
  


ucfirst.php

   <source lang="html4strict">

<?php

  $sentence = "the newest version";
  echo ucfirst($sentence);

?>

 </source>