I need to repeatedly remove certain stop words from articles. Currently I am using the function str_replace to achieve this. As the first argument I use the stop list array
This should work:
$i = $string; foreach($swarray as $word) { $i = str_replace(" " . $word . " ", "", $i ); }