Learning PHP and MySQL

Example 11-12 Using the word case functions

<?php
   $username
="John  Doe";
    echo(
"$username  in  upper  case  is  ".strtoupper($username).".<br>");
    echo(
"$username  in  lower  case  is  ".strtolower($username).".<br>");
    echo(
"$username  in  first  letter  upper  case  is  ".ucwords($username).".<br>");
?>

The code in Example 11-12 displays lowercase, uppercase, and other details.

Posted by on 08/18 at 05:54 PM

Next entry: Example 11-13 Detecting whether a string is contained in another string

Previous entry: Example 11-11 Calculating the length of a string

<< Back to main