Possible Duplicate:
Any more concise way to set default values?
Is there a built-in php function like the following:
function isset_get($array, $key, $default = null) {
return isset($array[$key]) ? $array[$key] : $default;
}
I don't like
$my_var = isset($my_array['some Key']) ? $my_array['some Key'] : '';
and would prefer
$my_var = isset_get($my_array, 'some Key', '');
or something similar...
$my_var = $my_array['key'] || $default;
– Ortrud