Home > Backend Development > PHP Tutorial > html5 - php怎么处理表单type为month类型的数据

html5 - php怎么处理表单type为month类型的数据

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:14:18
Original
1291 people have browsed it

前端post过来的数据如下
html5 - php怎么处理表单type为month类型的数据
后台怎么对它进行处理。怎么跟数据库的时间字段进行对比。

回复内容:

前端post过来的数据如下
html5 - php怎么处理表单type为month类型的数据
后台怎么对它进行处理。怎么跟数据库的时间字段进行对比。

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

<code>    $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);</code>
Copy after login

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

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
html5 validation for symfony 2.1
From 1970-01-01 08:00:00
0
0
0
The difference between HTML and HTML5
From 1970-01-01 08:00:00
0
0
0
html5 show hide
From 1970-01-01 08:00:00
0
0
0
Can PDF files run HTML5 and Javascript?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template