I have an array that contains words like 'free advice', 'consulting', 'ask for free' etc. And I want to remove elements that contain the word 'free'. I have the following codes but the output is blank.. Can anyone help me? Thank you in advance!
foreach ($myarray as $value){
// remove words containing 'free'
if (strpos($value, 'free') !== false) {
unset($myarray[$value]);
}
}