Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Apr 2006
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    simple searching script

    hi,

    I need a simple way to perform a string search.

    e.g.
    #
    I need to search for "I LOVE PHP"

    but when i only type in "I Lov" => it should be able to match the entire string, clean spaces, clean special chars, clean slashes.
    #

    I only know how to use
    preg_match("/$search_string/i", "$word");
    but requires that $search should be accurate to the $word

    Thanx in Advance.

  • #2
    Senior Coder
    Join Date
    Apr 2005
    Posts
    1,051
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by m@l@y@ View Post
    hi,

    I need a simple way to perform a string search.

    e.g.
    #
    I need to search for "I LOVE PHP"

    but when i only type in "I Lov" => it should be able to match the entire string, clean spaces, clean special chars, clean slashes.
    #

    I only know how to use
    preg_match("/$search_string/i", "$word");
    but requires that $search should be accurate to the $word

    Thanx in Advance.
    little more information required. I.e how are you storing results to search from?
    are you querying a db of keywords? or text strings?

    best way would be to split up the string then match the parts and give an overall weighting then display results based off overall weightings..
    public string ConjunctionJunction(string words, string phrases, string clauses)
    {
    return (String)(words + phrases + clauses);
    }
    <--- Was I Helpfull? Let me know ---<


  •  

    Posting Permissions

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