我正在尝试将多选的值列出到 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>";
最佳答案
有这样的事吗? (未经测试)
$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>
";
引用:
关于javascript - 如何将多选的值放入 echo 语句中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37735039/