3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function parseStopWords($text){ $text = preg_replace('/[^a-zA-Z0-9áéíóúñ\',]/i','',$text); $stopwords = array('a','ante','bajo','cabe','con','contra','de','desde','en','entre','hacia','hasta','para','por','sin','sobre','tras','el','lo','la','los','las','un','unos','una','al','del','que','es','se','y','fue'); foreach($stopwords as $w){ $text = preg_replace('/\b'.$w.'\b/i','',$text); } return $text; } var_dump(parseStopWords("Hello world"));
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(10) "Helloworld"