购物车价值通过邮件发送

时间:2018-02-08 05:10:07

标签: php email

我正在编写一个自定义邮件表格,我想在其中发送购物车价值详情以及联系方式。

我试过这样:

$product_name = explode(', ', $_REQUEST['product_name'], 2);
$numbers = [];
foreach ($product_name as $key => $value) {
    $numbers[] = $value . " ,";
}
$pr_name = implode(',', $numbers);
// foreach($product_name as $value) {
//     $qtyOut = $value."<br>";
// }
// $pname = $qtyOut;
$product_qty = explode(', ', $_REQUEST['product_qty'], 2);
$qty = [];
foreach ($product_qty as $key => $value) {
    $qty[] = $value . " ,";
}
$pr_qty = implode('', $qty);
echo $pr_name;
echo $pr_qty;   

$message .= "<tr><td><strong>Product Name:</strong> </td><td>$pr_name</td></tr>";
$message .= "<tr><td><strong>Product Quantity:</strong> </td><td>$pr_qty</td></tr>";

当我发送数据时,只发送最后一行值,而不是其他详细信息。可能我想......数组或foreach循环中存在问题。请帮帮我。

0 个答案:

没有答案