In PHP how can I pass on an identifier to a function to retrieve a value from a multi-dimensional array? With the below function, how can I return 'Female', using the $identifier variable?
function phrase($identifier) {
$lang = array();
$lang['settings'] = 'Personal settings';
$lang['entergender'] = 'Please select your gender';
$lang['gender']['m'] = 'Male';
$lang['gender']['f'] = 'Female';
return $lang[$identifier];
}
phrase('gender/f');//obviously this won't work