PHP match string with special characters?

Tom B

New member
Heya,

I am trying to make a search feature for a site, but it needs to be able to work with special characters. I get all results from my database using LIKE, which gets me plenty of results.

But I want something like Best Match.

ie. user inputs (word)

If I use REGEX to loop and check all results it returns all results that match word, because () have a meaning in REGEX.

I don't want the user to be able to input something like [a-z] and get all results back, I want to filter it so that the Best Matches are on top.

Any ideas?
 
Back
Top