I have the following array output:
Array
(
[c-1103-5-pca-x-tra] => Array
(
[name] => C 110.3-5 PCA X-tra
[2] => Array
(
[specification] => Afmeting (L*B*H)
[value] => 240*240*660
[unit] => mm
)
[6] => Array
(
[specification] => Elektrische aansluitwaarde
[value] => 230
[unit] => Volt/50 Hz
)
[9] => Array
(
[specification] => Garantietermijn
[value] => 5
[unit] => jaar
)
[46] => Array
(
[specification] => Automatische start/stop
[value] => Ja
[unit] =>
)
)
[c-1103-5-pc-x-tra] => Array
(
[name] => C 110.3-5 PC X-TRA
[2] => Array
(
[specification] => Afmeting (L*B*H)
[value] => 240x240x660
[unit] => mm
)
[5] => Array
(
[specification] => Elektrische aansluitwaarde
[value] => 1.4
[unit] => kw
)
[9] => Array
(
[specification] => Garantietermijn
[value] => 5
[unit] => jaar
)
[40] => Array
(
[specification] => Watertoevoertemperatuur
[value] => Maximaal 40
[unit] => °C
)
)
)
The c-1103-5-pca-x-tra and c-1103-5-pc-x-tra are the selected 2 products as an example, because people are allowed to select max 3 products. The numbers following are the specification_id of that corresponding product.
As you can see, these 2 products has some identical specifications, but also different specification.
I want to put these arrays in a table to show users the comparison of the specification of the selected products.
I started with the code below to output at least the name:
echo '<table border="1">';
echo '<tr>';
echo '<th></th>';
foreach ( $aSpecsProduct as $aProduct )
{
echo '<th>' . $aProduct['naam'] . '</th>';
}
echo '</tr>';
echo '</table>';
Now, I don't have a clue how to start with putting the arrays in a table, with on the leftside the specification (all specification of both products - of course without double specification if both products have the same specification).