Home >Backend Development >PHP Tutorial >PHP compares the size of two absolute times_PHP tutorial

PHP compares the size of two absolute times_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:39:51955browse

Copy code The code is as follows:

$zero1=date(“y-m-d h:i: s”);
$zero2=”2010-11-29 21:07:00′;
echo “The time of zero1 is:”.$zero1.”
”;
echo “ The time of zero2 is: ".$zero2."
";
if(strtotime($zero1) echo “zero1 is earlier than zero2′;
}else{
echo “zero2 is earlier than zero1′;
}
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/728091.htmlTechArticleCopy the code as follows: ?php $zero1=date(“y-m-d h:i:s”); $zero2 =”2010-11-29 21:07:00′; echo “The time of zero1 is:”.$zero1.”br”; echo “The time of zero2 is:”.$...
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