Remove elements of one array if it is found in another [duplicate]

You are looking for array_diff:

$subject = "Warmly little in before cousin as sussex...";
$tags = explode(" ", strtolower($subject));

$definite_articles = array('the','this','then','there','from','for','to','as');

$tags = array_diff($tags, $definite_articles);
print_r($tags);

See it in action.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)