Please help me to see why the selection of this condition is always incorrect. This post was last edited by yinfoo8 from 2012-11-2415: 05: 49. First question: $ weekarray & nbsp; date (w); echo & nbsp; $ weekarray; if & nbsp; ($ weekarray & nbsp; 5 & nbsp;) {Please help me to see why this condition is always incorrect.
This post was last edited by yinfoo8 at 15:05:49 on
First question:
$weekarray = date("w");
//echo $weekarray;
if ($weekarray =5 ){
$tomorrow = dgmdate(TIMESTAMP + '259200', 'Y-m-d');
}
elseif($weekarray = '6'){
$tomorrow = dgmdate(TIMESTAMP + '172800', 'Y-m-d');}
else {$tomorrow = dgmdate(TIMESTAMP + '86400', 'Y-m-d');}
$todaytime = strtotime(dgmdate(TIMESTAMP, 'Ymd'));
Today is Saturday, and echo $ weekarray shows 6. at this time, $ tomorrow = dgmdate (TIMESTAMP + '000000', 'Y-m-D ');
But why always choose $ tomorrow = dgmdate (TIMESTAMP + '000000', 'Y-m-D ');
Second question:
$ _ G ['timestamp']. what does this mean?
$ Todaytime = strtotime (dgmdate (TIMESTAMP, 'ymmd'); what does this mean?
------ Solution --------------------
If ($ weekarray = 5 ){
Elseif ($ weekarray = '6 '){
Dgmdate is a custom FUNCTION.
------ Solution --------------------
$ _ G ['timestamp'] // This is the dedicated timestamp of the discuz system.
$ Todaytime = strtotime (dgmdate (TIMESTAMP, 'ymmd '));
// You can see that 'ymmd' is only accurate to the day. Therefore, the value of $ todaytime is similar to the value of string 20121124.