|
Posted by TSmith on 06/14/07 16:52
Hey Y'all,
I haven't programmed in PHP in quite a while. Could anyone help me
with a foreach loop in a nested array? I have a function which returns
$stock (for an online pricing catalog).
$stock[0] is ( [0] => Item, [1] => Sale, ...) an array of column
headers.
$stock[1][$i] is ([Item] => SL, [Sale] => 300, ...) an array of
column headers to value for item $i
What I have to print the header row for the pricing table is:
print("<TR>");
foreach ($stock[0] as $num => $val) {
print("<TH>" + $val + "</TH>");
}
print("</TR>");
I've also tried ($stock[0] as $x) print($x).
What returns is five zeroes. Not in table cells, just "<TR>00000</
TR>".
Does anyone have any ideas what I've done?
Thank you in advance,
Taylor Smith
[Back to original message]
|