Forum Moderators: coopster
>>>
this works
<?
$products= array( array( Code=> "AAA", Description => $aaa, Price => $p_a),
array( Code=> "BBB", Description => $bbb, Price => $p_b),
array( Code=> "CCC", Description => $ccc, Price => $p_c));
// to read it
for ($row=0; $row < 3; $row++ ) {
foreach ($products[$row] as $key => $value) {
echo "¦ $value";
}
echo"<br>";
}
?>
But it echoed a blank page and no error so I looked and looked again at the script but did not find what was wrong!
Then I posted an excerpt, and you two were also kind of puzzled untill jatar_k suggested a bad upload
well, I simply was calling the old script
thank you.
At least it's a demo of 2D array using associative :)
and how to show the results
don't be mad at me!
$out = '';
foreach ($products as $array) {
$out .= implode(' ¦ ', array_map('htmlentities', $array)) . "<br>";
}
print $out;