I am creating a festival webapp and we have two different sites. A vehicle can come to 'north', 'south', or 'both'.
The MySQL table stores a comma separated list with values of either '1', '2', or '1,2'.
Basically, I need the variable $site to be; North South or Both
I've tried the below (and other lsot iterations) but can't get the desired output
$a = array($r['site']);
if (in_array(array('1', '2'), $a)) {
$this->site = 'both';
}
if (in_array('1', $a)) {
$this->site = 'north';
}
if (in_array('2', $a)) {
$this->site = 'south';
}
Desired result is for $this->site to equal;
1 = North
2 = South
1,2 = Both