title: match any terms in text to a ready list of terms
body: <p>I have an array of terms:</p>
  
  <pre><code>$arr = [
    'black',
    'white and black',
    'lion',
    'fast',
    'zebra',
    'lion is fast',
    'zebra is white'
  ];
  </code></pre>
  
  <p>I want to filter this array according to a specific sentence, for example:</p>
  
  <p><code>zebra is white and black, and lion is fast</code></p>
  
  <p>I tried using <code>strpos</code> and some regex functions, but I didn't get the expected result. What I am expecting is to get the <code>minimum</code> amount of items in the list that matches parts of the sentence IN ORDER, which would be:</p>
  
  <pre><code>[
    'white and black',
    'zebra',
    'lion is fast'
  ]
  </code></pre>
  
  <p>That way I could separate the result to match parts from the sentence as:</p>
  
  <p><code>\zebra\ is \white and black\, and \lion is fast\</code></p>
  
  <p>and ignore other items in the array as they don't fully match.</p>
  
  <p>Can you please lead me to the correct way to do it?</p>