convert string to lowercase or upper case in php - PHP Views : 379
Tagged in : PHP
0 0
Send mail
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
By rajesh, On - 2010-01-03



    Login to add Comments .