title: How to replace "on , in , or , and , of , the"
body: <p>I have string like this</p>
  
  <pre><code>$string = "the man on the platform"
  </code></pre>
  
  <p>than i trim and remove white space</p>
  
  <pre><code>$words =    explode(' ', trim(preg_replace('/\s+/', ' ', $string)));
  
  print_r($words);
  </code></pre>
  
  <p>Result</p>
  
  <pre><code>Array ( [0] =&gt; the [1] =&gt; man [2] =&gt; on [3] =&gt; the [4] =&gt; platform) 
  </code></pre>
  
  <p>How can i remove 'on' and 'the' to get result like this that i can use later to loop and search in DB</p>
  
  <pre><code>Array ( [0] =&gt; man [1] =&gt; platform)
  </code></pre>