这么比较日期对吗

WBOY
Release: 2016-06-13 11:53:53
Original
1095 people have browsed it

这样比较日期对吗
if ("2014-03-18 09:15:31" echo 小
else
echo 大
好像行不通的样子,最后显示的是小
------解决方案--------------------
使用strtotime转换成时间搓比较就没问题了。

<br />if (strtotime("2014-03-18 09:15:31") < strtotime("2014-3-16 23:36:24")){<br />	echo '大';<br />}else{<br />	echo '小';<br />}<br />
Copy after login

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template