0

I have array as below ,

$array = Array
(
    [0] => Array
        (
            [machine_id] => DKAN0090
        )

    [1] => Array
        (
            [machine_id] => DKAN0170
        )

    [2] => Array
        (
            [machine_id] => DKAN0470
        )

    [3] => Array
        (
            [machine_id] => DKAN0370
        )

    [4] => Array
        (
            [machine_id] => DKAN0450
        )
....
....
....

   [4000] => Array
        (
            [machine_id] => DKAN0450
        )
);

but i want this array as below ,

$arterarray =Array
(
    [0] => DKAN0090
    [1] => DKAN0170
    [2] => DKAN0470
    [3] => DKAN0370
    [4] => DKAN0450
    ...
    ...
    ...
    [4000] => DKAN0789

); 

currently I have use below code to get final array ,

$machine= array();
        $i = 0;
        foreach ($array as $key => $record) {            
            $machine[$i] = $record["machine_id"];          
            $i++;
        }

Please suggest me another way to get result of this array arrangement , which can help me to get result faster ?

0 Answers0