Controlling Case : ucwords « String « PHP






Controlling Case

 
<?php
  $submittedpass = "myPass";
  $newpass = strtolower ($submittedpass);
  
  echo $newpass . "<br />";
  
  $astring = "hello world";
  echo ucfirst ($astring) . "<br />"; 
  
  $astring = "hello world";
  echo ucwords ($astring); 

?>
  
  








Related examples in the same category

1.ucwords() function capitalizes the first letter of each word in a string.
2.ucwords() makes the first letter of every word in a string uppercase.
3.ucwords.php
4.string ucwords ( string str ) converts the first letter of each word in the string to an uppercase character, leaving the others untouched.
5.submitted string lowercase with strtolower() before invoking ucwords():
6.Prettifying names with ucwords()