Is there a more efficient way to foreach check an array for similar values against multiple arrays? Here's my code:
foreach ($city as $option) {
if (in_array($option, $optionarray1)) {
$tables[] = 'newvalue1';
} else if (in_array($option, $optionarray2)) {
$tables[] = 'newvalue2';
} else if (in_array($option, $optionarray3)) {
$tables[] = 'newvalue3';
}
}