我有这段代码在变量中写入$products一串产品名称:
$products = '';
foreach($order->pad_products as $product) $products .= " $product->title";
当我在 HTML 电子邮件正文中打印$products并使用 PHP 发送电子邮件时,在这种情况下,我$msg会在一行中看到产品名称。
$msg = "
<html>
<head>
<style type='text/css'></style>
</head>
<body>
<h1>Sent!</h1>
<p>$name thank you</p>
$products
</body>
</html>";
我怎样才能列出这些产品?而且,我可以删除其中之一吗?