Case Replacr

Discussion in 'PHP' started by onlyican.com, Jan 17, 2006.

  1. #1
    Hey

    I have built a message function, and got someone to test it and hey, a glitch

    They typed my name is as Admin, when my name is admin.

    Now the database is saying I have a message

    If i view the message i can't

    I have a If statement saying
    if ($logged_in_user == $message_to) {

    show message

    }else{

    deny

    }

    anywho

    Is there a replace function to change all UPERcase to lowercase.

    I don't want to do a replace for A = a and B = b .....
     
    onlyican.com, Jan 17, 2006 IP
  2. UrbitasMedia

    UrbitasMedia Peon

    Messages:
    56
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Isn't PHP great?! The command you are looking for is call strtoupper().

    <?php
    $str = "Mary Had A Little Lamb and She LOVED It So";
    $str = strtoupper($str);
    echo $str; // Prints MARY HAD A LITTLE LAMB AND SHE LOVED IT SO
    ?>
     
    UrbitasMedia, Jan 17, 2006 IP
  3. UrbitasMedia

    UrbitasMedia Peon

    Messages:
    56
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Actually you need the strtolower() function.
     
    UrbitasMedia, Jan 17, 2006 IP
  4. onlyican.com

    onlyican.com Peon

    Messages:
    206
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I love PHP

    THanks
     
    onlyican.com, Jan 18, 2006 IP