rather than always using a combination of if ( issett($array['element']) && 'test' === $array['element'] ) { }
This function can be called
if ( 'test' === xzy_get_element(,$array, 'element', 'test' ) ) { }
or if a boolean just
if ( xzy_get_element(,$array, 'element' ) ) { } // if missing default is false
function could easily be extended to accept a santize key e.g. you use with $_POST arrays to ensure santisation