title: PHP library for parsing Google-like search operators?
body: <p>I want to create a PHP search function, but using Google-like operators. For instance:</p>
  
  <pre><code>these words "this phrase" location:"Los Angeles" operator:something
  </code></pre>
  
  <p>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.</p>
  
  <p>Or if it doesn't require a library, a nice way to do this would be good.</p>
  
  <p>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:</p>
  
  <pre><code>[0] =&gt; these
  [1] =&gt; words
  [2] =&gt; "this phrase"
  [3] =&gt; location:"Los Angeles"
  [4] =&gt; operator:something
  </code></pre>
  
  <p>From that I can build a search function for the database.</p>