I am writing a simpe code that finds if at least one word of a string is found on an array, like below:

**The array**

```
$the_array= array("first","second","third");

```

**The code**

```
if(0 < count(array_intersect(explode(' ', $input_string), $the_array))) {
  echo 'found';
  break;
} else {}

```

So if my `input_string` is

```
$input string = "hello here is my first sentence";

```

or

`you get now my second question`

or

`find my first and second sentence here`

the code will echo `found`.

My desired solution is to check strings like
`find my first and second sentence here`

against an array like below

`$the_array= array("first second","third");`

and echo `found`. But because there are words between the string `first and second` it will not do it.

Is there any way of achieving something like this? A more "intelligent" version?