function visitSelect(\cmu\html\form\products\Select $component) { foreach ($component->getOptionsArray() as $k => $v) { //check if the VALUE matches the SELECTEDVALUE if ($component->getSelectedvalue() == $v) { //we could also return $k if required (lookups), but will mostly be VALUE. Could add switch to return KEY return $component->getName() . ";" . $v; } } }