Results 1 to 2 of 2

Thread: Make a string lowercase letters

  1. #1
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Question Make a string lowercase letters

    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:
    PHP Code:
    <?
    $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:
    PHP Code:
    <?
    $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
    }
    ?>
    Last edited by fileserverdirect; 08-24-2007 at 10:44 PM. Reason: typo
    -Ben -- THE DYNAMIC DRIVERS
    My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
    I told my client to press F5, the client pressed F, then 5, *facepalm*

  2. #2
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    1,692
    Thanks
    82
    Thanked 90 Times in 88 Posts

    Default

    heh, too lazy to read, but
    Code:
    $another_variable=strtolower($another_variable);
    will convert all the letters in $another_variable to lower case.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •