I have an array with arrays in it representing values in a database.
There are over 100 columns in the db table so the actual count is much higher than this example below of 6 values, the sub-array (Array within the array) index 0-5.
The columns are in each index of the sub-array and the rows are in each index of the main array.
Here is my main array with sub-arrays:
Array
(
[0] => Array
(
[0] => N
[1] => N
[2] => Y
[3] => Y
[4] => Y
[5] => Y
)
[1] => Array
(
[0] => N
[1] => N
[2] => Y
[3] => Y
[4] => N
[5] => Y
)
[2] => Array
(
[0] => N
[1] => N
[2] => Y
[3] => Y
[4] => N
[5] => Y
)
[3] => Array
(
[0] => Y
[1] => Y
[2] => Y
[3] => Y
[4] => Y
[5] => Y
)
What I need to do is concat all the values of each sub index into one array like this:
Array
(
[0] => N,N,N,Y
[1] => N,N,N,Y
[2] => Y,Y,Y,Y
[3] => Y,Y,Y,Y
[4] => Y,N,N,Y
[5] => Y,Y,Y,Y
)
There will always be the same number of columns (sub index) but there will be different amounts of rows (index).