I have a multidimensional array with x number of arrays inside of it. Each internal array has 30 values. What I need to do is print each array's values vertically in columns as table rows then have a new column created for each array.
my array looks like this
Array (
[0] => Array ( [0] => 0.00 [1] => 0.00 [2] => 0.00 etc...)
[1] => Array ( [0] => 0.00 [1] => 0.00 [2] => 0.00 etc... )
[2] => Array ( [0] => 0.00 [1] => 0.00 [2] => etc... )
[3] => Array ( [0] => 0.00 [1] => 0.00 [2] => 0.00 etc...) )
I need the table to look something like this
Column 1 "array 0" | Column 2 "array 1" | Column 3 "array 2"
array [0]([1]=> value | array [1]([1]=> value | array [2]([1]=> value
array [0]([2]=> value | array [1]([2]=> value | array [2]([3]=> value
array [0]([3]=> value | array [1]([3]=> value | array [2]([3]=> value
etc....
I have tried different foreach loops but can't get the result I'm looking for.
Here is the code that I am currently using, but fails.
foreach($pension as $key){
echo "<tr>";
foreach($key as $value){
echo "<td>$value</td>";
}
echo "</tr>";
}
Printing the data horizontally would be easier, but I know there must be a solution. Any help would be great!