dtip91401 2018-06-28 09:21
浏览 160

在输入类型日期显示日期从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>

Above is my code and I want to fetch database values of the date of birth in my input type date attribute.
Thanks In Advance :)

  • 写回答

1条回答

  • dsfasdfsda234234 2018-06-28 09:31
    关注

    Please use yyyy-mm-dd format as a value. you have wrong spelled strftime function it should be 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>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 gradio的web端页面格式不对的问题
  • ¥15 求大家看看Nonce如何配置
  • ¥15 Matlab怎么求解含参的二重积分?
  • ¥15 苹果手机突然连不上wifi了?
  • ¥15 cgictest.cgi文件无法访问
  • ¥20 删除和修改功能无法调用
  • ¥15 kafka topic 所有分副本数修改
  • ¥15 小程序中fit格式等运动数据文件怎样实现可视化?(包含心率信息))
  • ¥15 如何利用mmdetection3d中的get_flops.py文件计算fcos3d方法的flops?
  • ¥40 串口调试助手打开串口后,keil5的代码就停止了