fork(2) download
  1. <?php
  2.  
  3. $data = array(
  4. 'A' => array(10,20,30),
  5. 'B' => array(100,200,300),
  6. 'C' => array(1000,2000,3000)
  7. );
  8.  
  9. $data_new = array();
  10. foreach($data as $key => $values)
  11. {
  12. if (is_array($values))
  13. {
  14. for($i = 0; $i < count($values); $i++)
  15. {
  16. $data_new[$i][] = array_shift($data[$key]);
  17. }
  18. }
  19.  
  20. }
  21.  
  22. print_r($data_new);
Success #stdin #stdout 0.02s 23688KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => 10
            [1] => 100
            [2] => 1000
        )

    [1] => Array
        (
            [0] => 20
            [1] => 200
            [2] => 2000
        )

    [2] => Array
        (
            [0] => 30
            [1] => 300
            [2] => 3000
        )

)