<分区>
我想检查星期一是否是假期,如果是,则将值分配给 $ts,否则转到星期二。
if (isset($list->hours_from_MON)) {
$ts = $list->hours_from_MON;
} else (isset($list->hours_from_TUE)) {
$ts = $list->hours_from_TUE;
数据库中的数据类似于 {"hours_from_Mon":"","hours_from_Tue":"2am to 5pm"}
Here in the above case it should take ts as 2am to 5pm,but it is accepting "",i think i should use
if (!empty($list->hours_from_MON)) {
$ts = $list->hours_from_MON;
} else (!empty($list->hours_from_TUE)) {
$ts = $list->hours_from_TUE;
So that it will go to tue if,mon has no value.Am i right?Can some one help me.