title: PHP Insert array to associative array at specific position
body: <p>I want insert one array to another associative array at specific position, but for me the array_splice doesn't work. 
  I want do this: </p>
  
  <pre><code>    $example = [
         'first' =&gt; 'element',
         'second' =&gt; 'element'];
      $example[] = [
         'third' =&gt; 'element',
         'fourth' =&gt; 'element'];
  </code></pre>
  
  <p>Now we have a associative array with inside with two another array.
  And I want to insert on another array in it, for example between it. It is important, i want to insert to a specific index. </p>
  
  <pre><code>     $insert[] = [
          'insert_first' =&gt; 'element',
          'insert_second' =&gt; 'element'];
       //I made before it: 
       $index = 1;
       array_splice($example, $index, 0, $insert); //but it doesn't work :(
  </code></pre>
  
  <p>I want the following result:</p>
  
  <pre><code>array(
   [0] =&gt; array(
      'first' =&gt; 'element',
      'second' =&gt; 'element'
   )
   [1] =&gt; array(
      'insert_first' =&gt; 'element',
      'insert_second' =&gt; 'element'
   )
   [2] =&gt; array(
      'third' =&gt; 'element',
      'fourth' =&gt; 'element'
   )
  )
  </code></pre>
  
  <p>Can somebody help me how can i made it? </p>
  
  <p>Thank, Balázs from Hungary.</p>