Just got the coding question about php
==============html input form=========================
<input name="itemname[]" type="text" readonly="readonly" value="iphone">
<input name="itemquantity[]" type="text" value="3">
<input name="itemname[]" type="text" readonly="readonly" value="samsung">
<input name="itemquantity[]" type="text" value="6">
<input name="itemname[]" type="text" readonly="readonly" value="IBM">
<input name="itemquantity[]" type="text" value="3">
==============PHP code(part1)==============
function productlist($itemname,$itemquantity) {
for($i=0;$i<count($itemname);$i++)
{
echo $itemname[$i] .",". $itemquantity[$i]."<br>";
}
}
$message = productlist($itemname, $itemquantity);
==============PHP code(part2)==============
$to = "[email protected]";
$subject = "Online order form";
mail($to, $subject, $message, $headers);
part1 result:
iphone,3
samsung,6
IBM,3
Question: the coding can run with part 1 result, may i know how to pass part1 result into part2 and can send out successfully.
thx so much
productlist()function has toreturnsomething if you want to call is like$message = productlist($itemname, $itemquantity);and NOTechoanythingimplodeand an array.