Log in

View Full Version : Make a string lowercase letters



fileserverdirect
08-24-2007, 10:40 PM
Ok, this might sound like a Super noobish question to some of you advanced programmers out there, but how do you make a php string all lowercase, I have seen it done in javascript (on this website). And I might have fliped pass it in my "PHP for dummies" book. but here is what I am trying to do:


<?
$command = $_GET['cmd'];
$another_variable = "OPTION1";//this will be set by the rest of the script
//change the above varables into lowercase
if($command=="refesh"||$another_variable=="option1") {
//some actions
}
?>

so I don't have to do this all the time:


<?
$command = $_GET['cmd'];
$another_variable = "OPTION1";//this will be set by the rest of the script
//change the above varables into lowercase
if($command=="refesh"||$another_variable=="option1"||$command=="REFRESH"||$another_variable=="OPTION1")
{
//some actions
}
?>

james438
08-24-2007, 11:12 PM
heh, too lazy to read, but
$another_variable=strtolower($another_variable); will convert all the letters in $another_variable to lower case.