What other alternatives for the if
statement in the following code, are there?
$page_title = $titles['default'];
$page_desc = $descriptions['default'];
if(array_key_exists($module, $titles) && !empty($titles[$module]))
{
$page_title = $titles[$module];
}
if(array_key_exists($module, $descriptions) && !empty($descriptions[$module]))
{
$page_desc = $descriptions[$module];
}
The above code works great, I'm just looking to see if there's any room of improvement.