我正在使用 PHP 邮件处理程序从我的网站发送查询信息。
除了我希望日期格式不同之外,一切都运行良好。
目前它正在发送日期yyyy-mm-dd
,我希望它是dd-mm-yyyy
一个长日期,例如dd-month-yyyy
.
<?php
$myWeb = "My Website";
$name = trim($_POST['name']);
$email = trim($_POST['email']);
$number = trim($_POST['number']);
$message = trim($_POST['message']);
$date = trim($_POST['date']);
$EmailTo = "mymail@myweb.com";
$Subject = "Enquiry from $myweb"; /// Add a subject
$Body = "$name has made an enquiry about: $myWeb\n\n";
$Body .= "Name: $name\n\n";
$Body .= "Email Address: $email\n\n";
$Body .= "Contact Telephone Number: $number\n\n";
$Body .= "Date of Event: $date\n\n";
$Body .= "$name's Enquiry:\n\n$message\n\n";
if($Subject == NULL) {$Subject = "From $myWeb";}
$success = mail($EmailTo, $Subject, $Body, "From: $myWeb");
if ($success){
header('Location: contact-form-thank-you.html','_self');
}
?>
有什么想法请我如何更改格式?