Hi Gurus
Please help me figure this out
$filter = array("just","very short", "long", "two words", "other"); // this list is about 400 array content
$str1 = "This is just a sample text, a very short one";
$str2 = str_replace($filter, "", $str1);
So when I echo $str2
"This is a sample text, a one"
My Question is. what is the best way to know what word(s) from $filter is present in $str1, since str_replace will only return the changed value. for this example ("just","very short") are the words I want to store in an array
Array
(
[0] => just
[1] => very short
)
Please note that I am only using PHP4.
Feel free to change the technique if you have other method of extracting the words given above.
Thank you for all your help