convert string to lowercase or upper case in php
by rajesh[ Edit ] 2010-01-03 14:46:48
To convert all the characters in a string to lower case (lowercase):
strtolower($string) — This function makes a string lowercase
Example
$str = "LOWERCASE as lower case";
$str = strtolower($str);
echo $str; // Prints "lowercase as lower case"
?>
To convert all the characters in a string to upper case (uppercase):
strtoupper($string) — This function makes a string upper case
Example
$str = "uppercase as UPPER CASE";
$str = strtolower($str);
echo $str; // Prints "UPPERCASE AS UPPER CASE"
?>
more functions
# ucfirst() - Make a string's first character uppercase
# ucwords() - Uppercase the first character of each word in a string