如何在文本文件的标题上显示时间

时间:2013-08-30 15:46:53

标签: php

你好我们如何在文本文件的标题中显示时间这里是我的代码:

 <?php
 header('Content-disposition: attachment; filename=test.txt');
 header('Content-type: text/plain');
 ...
 ?>

我想文件的标题可能就像这个test_ 2013年8月30日.txt我希望有人可以帮助我

1 个答案:

答案 0 :(得分:1)

您可以使用date功能,我不会使用spaces,

 header('Content-disposition: attachment; filename=test_' . date('F_j_Y') . '.txt');