title: How can I remove a single array member using array_splice in php?
body: <p>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.</p>
  
  <p>So, I have this array (print_r output):</p>
  
  <pre><code>Array ( 
  [0] =&gt; Array ( [TypeFlag] =&gt; S [qty] =&gt; 1 [denom] =&gt; 25 [certMessage] =&gt; [totalPrice] =&gt; 25 ) 
  [1] =&gt; Array ( [TypeFlag] =&gt; C [qty] =&gt; 2 [denom] =&gt; 25 [certMessage] =&gt; [totalPrice] =&gt; 50 ) 
  [2] =&gt; Array ( [TypeFlag] =&gt; V [qty] =&gt; 2 [denom] =&gt; 25 [certMessage] =&gt; test [totalPrice] =&gt; 50 ) )
  </code></pre>
  
  <p>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):</p>
  
  <pre><code>$cart = array_splice($cart, 1,1);
  </code></pre>
  
  <p>But what I end up with is this when doing a print_r:</p>
  
  <pre><code>Array ( [0] =&gt; Array ( [TypeFlag] =&gt; C [qty] =&gt; 2 [denom] =&gt; 25 [certMessage] =&gt; [totalPrice] =&gt; 50 ) ) 
  </code></pre>
  
  <p>So it appears to be removing 0 and 2, and leaving 1 as the remainder. What am I doing wrong?</p>