繁体   English   中英

在输入类型日期显示日期从PHP数据库

[英]In input type date display date from database in php

<label class="w3-text-teal"><b>Date Of Birth</b></label>
<input class="w3-input w3-border w3-light-grey" type="date" value="<?php echo strftime('%Y-%m-%d',strtotime($row['date_of_birth'])); ?>" name="dob" required>

上面是我的代码,我想在输入类型date属性中获取出生日期的数据库值。
提前致谢 :)

请使用yyyy-mm-dd格式作为值。 您拼写错误的strftime函数应该是strtotime

<label class="w3-text-teal"><b>Date Of Birth</b></label> <input class="w3-input w3-border w3-light-grey" type="date" value="<?php echo strtotime('%Y-%m-%d',strtotime($row['date_of_birth'])); ?>" name="dob" required>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM