This question already has an answer here:
I have a foreach loop where I want to unset an item from an array if certain conditions are met, like this:
foreach ($array as $element) {
if (conditions) {
unset($element);
}
}
But the element is not unset after that. What am I doing wrong? Am I unsetting a reference to the actual element or something like that?
</div>