title: Assign one array values into another one array in for loop in php
body: <p>I have an array like this</p>
  
  <pre><code>$arr1 = Array
  (
      [0] =&gt; 0
      [1] =&gt; 0
      [2] =&gt; 0
      [3] =&gt; 1
      [4] =&gt; 1
      [5] =&gt; 1
      [6] =&gt; 0
  )
  $arr2 = Array
  (
      [0] =&gt; 1
      [1] =&gt; 0
      [2] =&gt; 0
      [3] =&gt; 0
      [4] =&gt; 0
      [5] =&gt; 0
      [6] =&gt; 1
  )
  </code></pre>
  
  <p>I want to create a new array with the values of a2 as keys in $arr1. My resultant array should be like this</p>
  
  <pre><code>$arr3 = Array
  (
      [0] =&gt; $arr1 = Array
  (
      [0] =&gt; 0
      [1] =&gt; 0
      [2] =&gt; 0
      [3] =&gt; 1
      [4] =&gt; 1
      [5] =&gt; 1
      [6] =&gt; 0
  )
      [1] =&gt; $arr2 = Array
  (
      [0] =&gt; 1
      [1] =&gt; 0
      [2] =&gt; 0
      [3] =&gt; 0
      [4] =&gt; 0
      [5] =&gt; 0
      [6] =&gt; 1
  )
  )
  </code></pre>
  
  <p>Note : All are in a for loop. Plz help me..</p>