armaclans
Member
I have a custom join field with a tag {$acf_hoursop}. it is checkboxes
This field has:
internal values,
If I want to check if a value exists wouldn't the code be a simple if in array statement?
Something tells me, that I need to tell the $TMPL to be an array.. Any suggestions?
This field has:
internal values,
- mon
- tue
- wed
- thurs
- fri
- sat
- sun
If I want to check if a value exists wouldn't the code be a simple if in array statement?
PHP:
if (in_array('mon', $TMPL['acf_hoursop']))
{
$TMPL['mon_hoursop'] = '<div class="row custom"><div class="col-md-6 left"><i class="fa fa-clock-o"></i> <b> MONDAY WAS CHECKED</b></div><div class="col-md-6 right"></div></div>';
} else {
$TMPL['mon_hoursop'] = '<div class="row custom"><div class="col-md-6 left"><i class="fa fa-clock-o"></i> <b> MONDAY WAS NOT</b></div><div class="col-md-6 right"></div></div>';
}