如何使用HTML输入类型“日期标记”设置当前日期


How to set current date with HTML input type Date Tag

我是php新手,我想在我的HTMl日期标签中设置当前日期

<input type="date" value="Today">

如何获取当前日期?

尝试使用date函数作为

<input type="date" value="<?php echo date('Y-m-d');?>">

您需要遵循标准Y-m-d格式

<input type="date"  name="current_date" value="<?php echo date("Y-m-d") ?>">

您需要遵循标准Y-m-d格式使用这个。

<input type="date"  name="current_date" value="<?php echo date("Y-m-d") ?>">