title: How to merge object array with normal array in php?
body: <p>I have two arrays like below:</p>
  
  <p>array 1:</p>
  
  <pre><code>array([0]=&gt; 11, [1] =&gt; 2.5)
  </code></pre>
  
  <p>array  2: </p>
  
  <pre><code>Array ( 
      [0] =&gt; stdClass Object ( 
          [type] =&gt; 1 
          [creator_id] =&gt; 3 
          [creator_name] =&gt; E1 
          [per_tar] =&gt; 300 
          [pro_tar] =&gt; 200 
          [ac] =&gt; 300 
          [PA] =&gt; 17 
          [Q1] =&gt; 800 
      ) 
      [1] =&gt; stdClass Object ( 
          [type] =&gt; 1 
          [creator_id] =&gt; 4 
          [creator_name] =&gt; E2 
          [per_tar] =&gt; 100 
          [pro_tar] =&gt; 170 
          [ac] =&gt; 0 
          [PA] =&gt; 7 
          [Q1] =&gt; 270 
      ) 
  ) 
  </code></pre>
  
  <p>What i want is i want to merge the array 1 with array 2 by the following way </p>
  
  <p>array 1 key [0] is merged insed the array 2  key [0] object same for all keys.</p>
  
  <p>So my expected output is:</p>
  
  <pre><code>Array ( 
      [0] =&gt; stdClass Object ( 
          [type] =&gt; 1 
          [creator_id] =&gt; 3 
          [creator_name] =&gt; E1 
          [per_tar] =&gt; 300 
          [pro_tar] =&gt; 200 
          [ac] =&gt; 300 
          [PA] =&gt; 17 
          [Q1] =&gt; 800
          [new] =&gt; 11 
      ) 
      [1] =&gt; stdClass Object ( 
          [type] =&gt; 1 
          [creator_id] =&gt; 4 
          [creator_name] =&gt; E2 
          [per_tar] =&gt; 100 
          [pro_tar] =&gt; 170 
          [ac] =&gt; 0 
          [PA] =&gt; 7 
          [Q1] =&gt; 270
          [new] =&gt; 2.5 
      ) 
  ) 
  </code></pre>
  
  <p>I am trying the <code>array_merge()</code> function but its merge the both array only. Please help me  </p>