How can I remove a single array member using array_splice in php?

I think I may not understand correctly how array_splice is supposed to work. My understanding is that the first param is your initial array, the second param is the element to start at, and the third param is the length, or number of elements to remove/replace.So, I have this array (print_r output):\[code\]Array ( [0] => Array ( [TypeFlag] => S [qty] => 1 [denom] => 25 [certMessage] => [totalPrice] => 25 ) [1] => Array ( [TypeFlag] => C [qty] => 2 [denom] => 25 [certMessage] => [totalPrice] => 50 ) [2] => Array ( [TypeFlag] => V [qty] => 2 [denom] => 25 [certMessage] => test [totalPrice] => 50 ) )\[/code\]I want to completely remove the second element (the array with index of 1; TypeFlag = C, etc.) I do not want to replace it with anything; just to return the array with the remaining two elements. I've tried this (where cart is the array name):\[code\]$cart = array_splice($cart, 1,1);\[/code\]But what I end up with is this when doing a print_r:\[code\]Array ( [0] => Array ( [TypeFlag] => C [qty] => 2 [denom] => 25 [certMessage] => [totalPrice] => 50 ) ) \[/code\]So it appears to be removing 0 and 2, and leaving 1 as the remainder. What am I doing wrong?
 
Back
Top