Home > Backend Development > PHP Tutorial > 请帮忙见见 为什么这个条件选择 总是选择不对

请帮忙见见 为什么这个条件选择 总是选择不对

WBOY
Release: 2016-06-13 12:59:48
Original
877 people have browsed it

请帮忙看看 为什么这个条件选择 总是选择不对啊

本帖最后由 yinfoo8 于 2012-11-24 15:05:49 编辑 第一个问题:

$weekarray = date("w");<br />
//echo $weekarray;<br />
if ($weekarray =5 ){<br />
<br />
	$tomorrow = dgmdate(TIMESTAMP + '259200', 'Y-m-d');<br />
	<br />
	}<br />
	<br />
	elseif($weekarray = '6'){<br />
$tomorrow = dgmdate(TIMESTAMP + '172800', 'Y-m-d');}<br />
<br />
    else {$tomorrow = dgmdate(TIMESTAMP + '86400', 'Y-m-d');}<br />
<br />
<br />
$todaytime = strtotime(dgmdate(TIMESTAMP, 'Ymd'));<br />
Copy after login


今天是周六, echo $weekarray 显示的是6, 这个时候$tomorrow = dgmdate(TIMESTAMP + '172800', 'Y-m-d');

但为什么总是选择$tomorrow = dgmdate(TIMESTAMP + '259200', 'Y-m-d');

第二个问题:

$_G['timestamp'], 这个是什么意思?
$todaytime = strtotime(dgmdate(TIMESTAMP, 'Ymd')); 这个又是什么意思啊
------解决方案--------------------
if ($weekarray ==5 ){

elseif($weekarray == '6'){

dgmdate应该是一个自定义的FUNCTION。
------解决方案--------------------
$_G['timestamp'] // 这个是 discuz 系统的专用的时间戳  <br />
$todaytime = strtotime(dgmdate(TIMESTAMP, 'Ymd'));  <br />
// 可以看到 'Ymd' 只精确到了天。因此$todaytime 的值类似于字符串 20121124
Copy after login
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