I have some arrays which looks like below
array(
[0] =>
array( ['direction'] => '0.000,0.160,0.123,0.104,0.000' )
[1] =>
array( ['direction'] => '0.000,0.101,0.237,0.101,0.000' )
[2] =>
array( ['direction'] => '0.000,0.160,0.125,0.163,0.000' )
)
with for loop, I would like to generate new array which would looks like
data1 = [0.000, 0.000, 0.000]
data2 = [0.160, 0.101, 0.160]
data3 = [0.123, 0.237, 0.125]
data4 = [0.104, 0.101, 0.163]
data5 = [0.000, 0.000, 0.000]
which means with for loop, I would like to get each column of value then assign that value to each new array.
what I tried to do is
$cnt = count($array);
$buildCnt = count($array['direction']);
for($i = 0; $i < $cnt; $i++){
for($j = 0; $j < buildCnt; $j++){
'i need to do something here
}
}
anyone help me please?? Thanks