title: Php find word in text using regular expression
body: <p>I want to find the whole words in text not a sub string.
  I have written following code.</p>
  
  <pre><code>$str = 'its so old now.';
  $a   = 'so';
  if (stripos($str,$a) !== false) {
   echo 'true';
  } else {
   echo 'false';
  }
  
  str1 = 'its so old now.';
  str2 = 'it has some issue.';
  </code></pre>
  
  <p>I want to find word 'so' in text. it give true in both the string. But I want true in first case only because in second string 'so' contains in 'some' words.</p>
  
  <p>Thanks in advance</p>