title: Assign value from one array to values from another
body: <p>I have three arrays:</p>
  
  <pre><code>$objective = isset($_POST['objective'])?$_POST['objective']:'';
  $key_result = isset($_POST['key_result'])?$_POST['key_result']:'';
  $doit = isset($_POST['doit'])?$_POST['doit']:'';
  
  Array ( [0] =&gt; Objective 1 [1] =&gt; Objective 2 ) 
  Array ( [0] =&gt; key_result 1 1 [1] =&gt; key_result 1 2 [2] =&gt; key_result 1 3 [3] =&gt; key_result 2 1 [4] =&gt; key_result 2 2 ) 
  Array ( [0] =&gt; doit [1] =&gt; doit 2 ) 
  </code></pre>
  
  <p>Is there any way I can get something like this:</p>
  
  <pre><code>Array ( [0] =&gt; Array ( 
                          [0] =&gt; Objective 1 
                          [1] =&gt; key_result 1 1 
                          [2] =&gt; key_result 1 2 
                          [3] =&gt; key_result 1 3 
                          [4] =&gt; doit
                       ) 
          [1] =&gt; Array ( 
                          [0] =&gt; Objective 2 
                          [1] =&gt; key_result 2 1 
                          [2] =&gt; key_result 2 2 
                          [3] =&gt; doit 2
                       ) 
  )
  </code></pre>
  
  <p>What i tried:</p>
  
  <pre><code>foreach( $objective as $obj =&gt; $ob ) 
  {
      $array_test4[] = array($ob, $key_result[$obj], $doit[$obj]);
  
      $test4 = implode('&lt;&gt;',array_map(function ($innerArray) {
      return implode("|",$innerArray);
      },$array_test4));
  }print_r($array_test4);
  </code></pre>
  
  <p>But I dont get what i want. How can I achieve this? </p>