$array[1] = array("Name1"=> array("2"=>"1460","3"=>"1868","4"=>"2158","5"=>"2537","6"=>"2915","8"=>"3673"));
$array[2] = array("Prod2"=> array("3"=>"3079","4"=>"3625","5"=>"4172","6"=>"4718","8"=>"5811"));
$cnt = 0;
for ($x = 0; $x < 100; $x++) {
$product = $array[$x]; // dynamic all product`s - $name
foreach ($product as $good =>$massiv) {
$name = key($product); // prod name
$proklkadok = array_keys($massiv); // prod prokladok
foreach ($massiv as $inner_key =>$price) {
echo "<tr><td>". $name. "</td>";
$pr_val = array_keys($massiv);
echo "<td>".$pr_val[0]. "</td>";
echo "<td>".$price."</td></tr>\r\n"; // product price
}
}
}
how to print $pr_val
unique in table td cell ?
This code is wrong, bad table prints the output:
Name1 2 1138 or wrong output too ... Name1 2,3,4,5,6,8 1138
Name1 2 1868 or wrong output too ... Name1 2,3,4,5,6,8 1868
Name1 2 2158 or wrong output too ... Name1 2,3,4,5,6,8 2158
Prod2 3 3079 or wrong output too ... Prod2 2,3,4,5,6,8 3079
Prod2 3 3625 or wrong output too ... Prod2 2,3,4,5,6,8 3625
Prod2 3 4718 or wrong output too ... Prod2 2,3,4,5,6,8 4718
Prod2 3 5811 or wrong output too ... Prod2 2,3,4,5,6,8 5811
Correct output must be in HTML TABLE
Name1 2 1138
Name1 3 1868
Name1 4 2158
Name1 5 2537
Name1 6 2915
Name1 8 3673
Prod2 3 3079
Prod2 4 3079
Prod2 5 3625
Prod2 6 4718
Prod2 8 5811
pls help me, I can't count and output different count of array keys in the table output