Home >Backend Development >PHP Tutorial >php比较两个绝对时间的大小_php实例

php比较两个绝对时间的大小_php实例

WBOY
WBOYOriginal
2016-06-07 17:22:10880browse

复制代码 代码如下:

$zero1=date(“y-m-d h:i:s”);
$zero2=”2010-11-29 21:07:00′;
echo “zero1的时间为:”.$zero1.”
”;
echo “zero2的时间为:”.$zero2.”
”;
if(strtotime($zero1) echo “zero1早于zero2′;
}else{
 echo “zero2早于zero1′;
}
?>
Statement:
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