Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

remove array words from string php

function removeCommonWords($input){
 
 	// EEEEEEK Stop words
	$commonWords = array('a','able','about','above','abroad','according','accordingly','across','actually','adj','after','afterwards','again','against','ago','ahead','all','allow','allows','almost','alone','along','alongside','already','also','although','always','am','amid', 'etc');
 
	return preg_replace('/('.implode('|',$commonWords).')/','',$input);
}
//Use it:
$mycleantext = removeCommonWords("I like the people with great ideas.");
 
PREVIOUS NEXT
Tagged: #remove #array #words #string #php
ADD COMMENT
Topic
Name
4+6 =