I am doing a search on my database. If the user enters eg. "foo bar" I want to display rows that have both "foo" AND "bar".
My SQL syntax looks like this: SELECT * FROM t1 WHERE MATCH (t1.foo_desc, t2.bar_desc) AGAINST ('+foo* +bar*')
How can I change the user input "foo bar" into "+foo* +bar*" using a regular expression in PHP?