How to divide time by 3?
I know $minute%3==0
could work if minute is 0,3,9,12,15...
But how to judge if minute is 1,4,10,13,16, if minute is 2,5,11,14,17?
Thanks.
$minute = date('i');
if($minute%3==0){
//if minute is 0,3,9,12,15...do something
}else if($minute%3+1==0){
//if minute is 1,4,10,13,16...do something
}else if($minute%3+2==0){
//if minute is 2,5,11,14,17...do something
}
Do it by checking the remainder of dividing by 3: