html5 - php怎么处理表单type为month类型的数据
PHP中文网
PHP中文网 2017-04-10 17:04:37
0
2
256

前端post过来的数据如下

后台怎么对它进行处理。怎么跟数据库的时间字段进行对比。

PHP中文网
PHP中文网

认证0级讲师

répondre à tous(2)
洪涛

你看这样行吗?希望对你有帮助

    $str = "Tue Mar 22 2016 15:07:48 GMT+0800 (中国标准时间)";
    $arr = explode("GMT+0800", $str);
    $time = strtotime($arr[0]);
    echo date("Y-m-d H:i:s", $time);
黄舟

html5 input type=month 的表示形式是YYYY-MM,你这里的格式确认是month?
https://www.w3.org/TR/html-markup/input.month.html
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_input_month

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal