title: How to remove the first element of array without changing its key value?
body: <p>There's an array in php</p>
  <pre><code>&lt;?php
  $array=array(&quot;a&quot;=&gt;&quot;123&quot;,&quot;b&quot;=&gt;&quot;234&quot;,&quot;c&quot;=&gt;&quot;345&quot;);
  array_shift($array);
  //array(&quot;0&quot;=&gt;&quot;234&quot;,&quot;1&quot;=&gt;&quot;345&quot;);
  ?&gt;
  </code></pre>
  <p>If I use this function, then key value gets changed. I want my key value to remain the same. How can I remove first element without affecting array key values.
  My answer should be like</p>
  <pre><code>array(&quot;b&quot;=&gt;&quot;234&quot;,&quot;c&quot;=&gt;&quot;345&quot;);
  </code></pre>
  <p>Note:Please do not use foreach(); I want to do this by existing array functions in php</p>
  <p>array_splice function is working for above array. But consider the below array</p>
  <pre><code>&lt;?php
  $array = Array
  (
      '39' =&gt; Array
          (
              'id' =&gt; '39',
              'field_id' =&gt; '620'
             
          ),
  
      '40' =&gt; Array
          (
              'id' =&gt; '40',
              'field_id' =&gt; '620',
              'default_value' =&gt; 'rrr',
            
  ));
  
  array_splice($array, 0, 1);
  print_r($array);
  ?&gt;
  </code></pre>
  <p>It is showing answer as follows:</p>
  <pre><code>Array ( [0] =&gt; Array ( [id] =&gt; 40 [field_id] =&gt; 620 [default_value] =&gt; rrr ) )
  </code></pre>
  <p>May I know the reason?? Will array_splice() work only for single dimensional array?? Now key value is reset...</p>