Home  >  Article  >  Backend Development  >  php指定时间内显示内容

php指定时间内显示内容

WBOY
WBOYOriginal
2016-06-23 13:56:461131browse

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


回复讨论(解决方案)

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

if('20'.date('y/n/d',time())=='2014/5/21'){    echo '你好';    }else{    echo '已过期';}

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