Hi.
I want to use PHP for search engine like searches.
What I will do:
select blah, blah from table1 where blah1 in (x, y, z) and blah1 not in (a, b, c)
MY PROBLEM:
The search string will be submitted from a form and I want that text field to be parsed and broken down into these categories:
terms that should be there (+ prefix
terms that should not be there (- prefix)
terms with wildcard(* anywhere in string)
example:
"+chair +book -table"
This should form 2 groups,
group1= chair, book
group2= table
Can someone show me how to compose this string. I know probably I need to use ereg, but don't have experience with regular expressions.
THANKS in advance.