Home  >  Article  >  Backend Development  >  php指定时间内显示内容,该如何处理

php指定时间内显示内容,该如何处理

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

php指定时间内显示内容
求一段可以在指定时间例如:在2014/5/21显示“您好!”代码,超过时间则显示“已过期!”。
------解决方案--------------------

echo date('Y/n/d') == '2014/5/21' ? '您好!' : '已过期!';

------解决方案--------------------
<br />if('20'.date('y/n/d',time())=='2014/5/21'){<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