PHP – Test Transformation (strtolower, strtoupper, ucfirst, ucwords

Text transformation in PHP is useful not just for esthetics, but to also make sure that data is uniform when dealing with databases and such.

strtolower()

strtoupper()

ucfirst()

ucwords()

textTransform.php

<?php

$string = "hello my Name is BOB.  WhAt is YOUr name?";

echo $string;

echo "<br><br>";

echo strtolower($string);

echo "<br><br>";

echo strtoupper($string);

echo "<br><br>";

echo ucfirst($string);

echo "<br><br>";

echo ucwords($string);

echo "<br><br>";

$string = strtolower($string);
echo ucwords($string);

?>

Be the first to comment

Leave a Reply