title: FInd array of words in String using regex
body: <p>I am looking to search some words in string , below is my code </p>
  
  <pre><code>$str="Chup Raho Episode 5 by Ary Digital 16th September 2014";
  
  $keywords=array('Ary digital','geo');
  
  echo in_string($keywords,$str,'all');
  </code></pre>
  
  <p><br></p>
  
  <pre><code>function in_string($words, $string, $option)
  {
  if ($option == "all") {
      $isFound = true;
      foreach ($words as $value) {
          $isFound = $isFound &amp;&amp; (stripos($string, $value) !== false); // returns boolean false if nothing is found, not 0
          if (!$isFound) break; // if a word wasn't found, there is no need to continue
      }
  } else {
      $isFound = false;
      foreach ($words as $value) {
          $isFound = $isFound || (stripos($string, $value) !== false);
          if ($isFound) break; // if a word was found, there is no need to continue
      }
  }
  return $isFound;
  }
  </code></pre>
  
  <p>This function return true or false , if word found it return 1 and if not it return 0.I need to return word which i am searching ,because i want to do another search on this word in mysql.
  Like if function found "Ary digital" then it should return "ary digital found".
  Help required.Thanks.</p>