Need help with search function.

Discussion in 'PHP' started by jfontestad, Dec 22, 2006.

  1. #1
    I'm trying to write a search function, but it's performing the search case sensitive. I need to make it case insensitive. Any ideas on how to accomplish this?

    Thanks.
     
    jfontestad, Dec 22, 2006 IP
  2. mani

    mani Peon

    Messages:
    679
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #2
    lol very easy, try to use strtolower and strtoupper functions to convert any case into lower or uper..:)

    such as $abc= "UPPER";
    you can compare
    if("upper"==strtolower($abc))

    if will return true whether $abc is in upper or lower, no matter
     
    mani, Dec 22, 2006 IP
  3. jfontestad

    jfontestad Well-Known Member

    Messages:
    1,236
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    148
    #3
    Thanks mani.

    I just searched for a complete search script and scratched the one I was writing.

    But none-the-less thanks.
     
    jfontestad, Dec 23, 2006 IP
  4. Wilhelm

    Wilhelm Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    or you could use the preg functions. :)
     
    Wilhelm, Dec 23, 2006 IP
  5. Seph

    Seph Peon

    Messages:
    84
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Seph, Dec 24, 2006 IP