I want to create a PHP search function, but using Google-like operators. For instance:
these words "this phrase" location:"Los Angeles" operator:something
It's important that operators like location: support values with spaces in them (hence the quotes in this example), so I can't just to a split or use standard tokens. I'd imagine someone at some point has created a library for doing this, but I can't find any.
Or if it doesn't require a library, a nice way to do this would be good.
It's just the parsing of a search query that I need; i.e. from the query above it would be fine to get an array consisting of:
[0] => these
[1] => words
[2] => "this phrase"
[3] => location:"Los Angeles"
[4] => operator:something
From that I can build a search function for the database.