Hi
I have an array of common words:
$common = array(a,the,abo ut,is,from,to,g o);
and a string that is a long paragraph of words.
$words
(It could of course be turned into and array as well.)
What I want to do is to remove the common words from my
string and I am not sure if I should do this with a regex, or a foreach loop
or if there is a particular array function that would suit the purpose.
I have looked through the array function list but can not see anything
specifically for this. I could perhaps use the change $words into an array
and use the in_array($words )
What would you recommend as the best way to do this ?
I have an array of common words:
$common = array(a,the,abo ut,is,from,to,g o);
and a string that is a long paragraph of words.
$words
(It could of course be turned into and array as well.)
What I want to do is to remove the common words from my
string and I am not sure if I should do this with a regex, or a foreach loop
or if there is a particular array function that would suit the purpose.
I have looked through the array function list but can not see anything
specifically for this. I could perhaps use the change $words into an array
and use the in_array($words )
What would you recommend as the best way to do this ?
Comment