我从电子邮件表单中获取帖子值,并将所有选项值设置为数字,并尝试将它们转换为实际字符串以在电子邮件中发送。我需要让这段代码更容易使用。
if ($subject == "1") {
$sub = "General Questions";
} elseif($subject == "2") {
$sub = "Membership";
} elseif($subject == "3") {
$sub = "Club Fees";
} elseif($subject == "4") {
$sub = "Proshop & Lessons";
} elseif($subject == "5") {
$sub = "Events";
} elseif($subject == "6") {
$sub == "Leagues & Programs";
} elseif($subject == "7") {
$sub == "Resturant & Bar";
};
也许我可以将 设置value=''
为实际值并一起跳过这部分。