I need to remove a certain key of my array since I'm creating a filter for my data.
Array(
[0]=>Array
(
['Column1'] => 'ABC'
['Column2'] => 'xxx'
)
[1]=>Array
(
['Column1'] => 'XYZ'
['Column2'] => 'xxx'
)
)
I want to remove the key (meaning the number 2) that has the value 'XYZ'. How can I remove it? I need to remove it because I am filtering the array that was thrown to me by another script and I need to remove the key. I tried using for loop but I do not know how to remove it.
for($z = 0; $z < count($array);$z++)
{
if($array[$z]['Column1'] == 'XYZ'){
// how do I remove the record [1] and all of its contents?
}
}