Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是场景,我有一个包含复选框的表单,提交后将发送到某个电子邮件。我正在尝试将检查的项目放入一个字符串中。喜欢 option1 option2 option 3
这是我现在所做的:
echo $message = foreach($_POST['checkbox'] as $checkbox){ echo $checkbox . "\r\n";}
$message 的期望输出:
Option1 Option2 Option3
请将其设为:
$message = ''; if (! empty($_POST['checkbox'])) { foreach($_POST['checkbox'] as $checkbox) { $message .= $checkbox . "\r\n"; } }