我试图将多选的值列入php电子邮件表单。变量是name =" variable []"
我不知道如何去做,所以任何建议都很棒
$message = "<html><head><title></title></head>
<body>
<p>Sentence".$_POST['somevarriable']."</p>
<p>Another Sentence". [I want to put an array here]."</p>
</body>
</html>";
答案 0 :(得分:1)
这样的东西? (未测试)
$message = "
<html>
<head><title></title></head>
<body>
<p>Sentence" .$_POST['somevarriable']. "</p>
<p>Another Sentence "
;
foreach ($_POST['variable'] as $selectedOption){
$message .= $selectedOption . ' ';
}
$message .= "
</p>
</body>
</html>
";
参考: