title: How to check if parts of a string are found into an array, but a more intelligent version?
body: <p>I am writing a simpe code that finds if at least one word of a string is found on an array, like below:</p>
  
  <p><strong>The array</strong></p>
  
  <pre><code>$the_array= array("first","second","third");
  </code></pre>
  
  <p><strong>The code</strong></p>
  
  <pre><code>if(0 &lt; count(array_intersect(explode(' ', $input_string), $the_array))) {
    echo 'found';
    break;
  } else {}
  </code></pre>
  
  <p>So if my <code>input_string</code> is</p>
  
  <pre><code>$input string = "hello here is my first sentence";
  </code></pre>
  
  <p>or</p>
  
  <p><code>you get now my second question</code></p>
  
  <p>or</p>
  
  <p><code>find my first and second sentence here</code></p>
  
  <p>the code will echo <code>found</code>.</p>
  
  <p>My desired solution is to check strings like
  <code>find my first and second sentence here</code></p>
  
  <p>against an array like below</p>
  
  <p><code>$the_array= array("first second","third");</code></p>
  
  <p>and echo <code>found</code>. But because there are words between the string <code>first and second</code> it will not do it.</p>
  
  <p>Is there any way of achieving something like this? A more "intelligent" version?</p>