如何在fwrite中包含日期?

时间:2012-10-22 09:57:36

标签: php forms email fwrite

我目前有一个fwrite,当填写表格时会发生,我想把表格填写在fwrite中的当前日期,我该怎么做?

fwrite($fh, "$firstname\r\n $lastname\r\n $email\r\n $zipcode\r\n $feedback\r\n \r\n");

1 个答案:

答案 0 :(得分:4)

试试这样:

$date=date("Y-m-d H:i:s");
fwrite($fh, "$firstname\r\n $lastname\r\n $email\r\n $zipcode\r\n $feedback\r\n $date\r\n \r\n");