I want to check whether monday is a holiday,if yes assign the value to $ts else go to tuesday.
if (isset($list->hours_from_MON)) {
$ts = $list->hours_from_MON;
} else (isset($list->hours_from_TUE)) {
$ts = $list->hours_from_TUE;
The data in database is like {"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.