Read 305 times | Created 2016-04-23 00:38:53 | Updated 2016-04-23 00:38:53 | | |

 

<?php
$input = array(
'januari'=>array(2,5,4,7,8,2),
'februari'=>array(6,2,8,5,4,3),
'maret'=>array(7,6,3,8,9,3)
);
echo "<pre>---Input--n";
print_r($input);
array_unshift($input, null);
$output = call_user_func_array('array_map', $input);
 
echo "---Output--n";
print_r($output);
 
hasilnya:
=========
 
---Input--
Array
(
    [januari] => Array
        (
            [0] => 2
            [1] => 5
            [2] => 4
            [3] => 7
            [4] => 8
            [5] => 2
        )
 
    [februari] => Array
        (
            [0] => 6
            [1] => 2
            [2] => 8
            [3] => 5
            [4] => 4
            [5] => 3
        )
 
    [maret] => Array
        (
            [0] => 7
            [1] => 6
            [2] => 3
            [3] => 8
            [4] => 9
            [5] => 3
        )
 
)
---Output--
Array
(
    [0] => Array
        (
            [0] => 2
            [1] => 6
            [2] => 7
        )
 
    [1] => Array
        (
            [0] => 5
            [1] => 2
            [2] => 6
        )
 
    [2] => Array
        (
            [0] => 4
            [1] => 8
            [2] => 3
        )
 
    [3] => Array
        (
            [0] => 7
            [1] => 5
            [2] => 8
        )
 
    [4] => Array
        (
            [0] => 8
            [1] => 4
            [2] => 9
        )
 
    [5] => Array
        (
            [0] => 2
            [1] => 3
            [2] => 3
        )
 
)