求php程序员解释一下代码!该如何处理

WBOY
Release: 2016-06-13 13:35:53
Original
783 people have browsed it

求php程序员解释一下代码!
   
$url = "http://www.csdn.com/index.php";
  $today = date("d");
  $time = date("G");
  if ((15   echo "域名备案中,备案成功后 即可正式开通网站";
   
  } else {
  echo "";
  }
 
?>
小弟求解以上php代码
最好在每句话后面加上注释
 $today = date("d");
  $time = date("G");
  if ((15
------解决方案--------------------
$today = date("d");//取得系统当前时间的日期
$time = date("G");//取得系统当前时间的小时 24小时制
if ((15 //判断日期是否是15号到21号之间 同时时间是8点到下午6点之间的时间内
------解决方案--------------------
手册上都有,其他就是逻辑了:http://download.csdn.net/detail/dmtnewtons/4122897
接上楼:
if(在该时间段内){
输出
}else{
利用JavaScript跳转至$url规定的页面
}
------解决方案--------------------
$today = date("d");//取得系统当前时间的日期
$time = date("G");//24小时制时间
echo $today." And ".$time;//请输出看一下你就明白了
也许因为时区设的不定,造成时间会有偏差,我们是东八区
date_default_timezone_set('PRC');

------解决方案--------------------
echo date("Y-m-d H:i:s"); //如果与系统时间不一致说明是 格林时间

 当前页面加上:date_default_timezone_set('PRC');
 或者php.ini中 令 date.timezone="PRC" (记得重启apache)

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!