Home >Backend Development >PHP Tutorial >php时间判断,该如何解决

php时间判断,该如何解决

WBOY
WBOYOriginal
2016-06-13 11:57:59999browse

php时间判断
想在某个时间段,例如:2014/5/21-2014/5/31显示“高级会员”日期超过2014/5/31则显示“会员已过期”,应该怎么做?
------解决方案--------------------

<br /><?php<br />if(time()>=strtotime('2014-5-21') && time()<=strtotime('2014-5-31')){<br />    echo '高级会员';<br />}else{<br />    echo '会员已过期';<br />}<br />?><br />

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