title: Remove words from a string in PHP
body: <p>I'm trying to remove some particular words from a given input string which is splitted into words. But from the splitted words array the particular words are not getting replaced.  </p>
  
  <pre><code>$string = $this-&gt;input-&gt;post('keyword');  
  echo $string; //what i want is you
  
  $string = explode(" ", $string);  
  
  $string = array_values(array_filter(preg_replace('/[^A-Za-z0-9\']/','', $string)));  
  
  $omit_words = array(' the ',' i ',' we ',' you ',' what ',' is ');  
  
  $keyword = array_values(array_filter(str_ireplace($omit_words,'',$string)));  
  print_r($keyword); // Array ([0] =&gt; what [1] =&gt; i [2] =&gt; want [3] =&gt; is [4] =&gt; you)  
  </code></pre>
  
  <p><strong>Expected output:</strong>  </p>
  
  <pre><code>Array ([0] =&gt; want)
  </code></pre>
  
  <p>I cant find out whats wrong in this. Please help me to solve this.</p>