Here's a good one. It's giving me a real headache.
Normally, if you have an array
e.g. $array = array($val1,$val2,$val3);
you can delete the contents by doing something like:
unset ($array[2]);
would delete '$val2' from the array.
How do you delete the contents of a 2 dimensional array of this kind of construct?:
$array1 = array($array2 = array(id => $id, code => $code, price => $price, qty => $qty));
i.e. I need to delete an entire $array2 from $array1.
unset() doesn't seem to work in this case. I guess it's because I'm trying to delete an array rather than the contents of an array.
An ideas?
Normally, if you have an array
e.g. $array = array($val1,$val2,$val3);
you can delete the contents by doing something like:
unset ($array[2]);
would delete '$val2' from the array.
How do you delete the contents of a 2 dimensional array of this kind of construct?:
$array1 = array($array2 = array(id => $id, code => $code, price => $price, qty => $qty));
i.e. I need to delete an entire $array2 from $array1.
unset() doesn't seem to work in this case. I guess it's because I'm trying to delete an array rather than the contents of an array.
An ideas?