0
我有一个表单发布一个数组,我遍历数组,我想在电子邮件中显示。显示循环中的每个项目
$qty = $_POST['qty'];
foreach($qty as $value)
{
$qtyOut = $value . "<br>";
}
然后我想要得到每一个的$qtyOut
并显示在我的电子邮件中。
我的电子邮件看起来像这样。
$message = "An order was submitted from: " . $additionalEmail . "<br/><br/>"
. "Customer Name: " . $custName . "<br/>"
. "Email:" . $customerEmail . "<br/>"
. "Message: <br/>"
. "<pre>" .$custName . "<br> "
. "Qty: ". $qtyOut . "Desc: " . $desc . "Options :" . $options . "Price : " . $price . "</pre>"
. "Submitted at: ". $time;
$message = wordwrap($message, 70, "\r\n");
我想有:
. "Qty: ". $qtyOut . "Desc: " . $desc . "Options :" . $options . "Price : " . $price .
显示为多次因为有订单行填写的电子邮件。
请有人指出我在正确的方向,因为只显示输入的最后一行。
它只是显示'数组1 2',其中2是最后一个项目输入所以它首先显示数组1,其应该在1过,然后2这是第二个项目已输入。 – StudentRik
请更具体一点,您的评论很混乱。请分享'qty数组',并且最终输出 –
qty数组只是在表单输入中。它使用'jQuery'进行序列化,并且显示的每个第一个元素在显示的值前面都有单词'Array'。这很奇怪。 – StudentRik