Для этого вы можете использовать функцию, содержащую инструкцию switch:
function GetPaymentMethod( $cardtype )
{
switch( $cardtype )
{
case 'visa':
return 'VSA';
case 'mastercard':
return 'MSC';
case 'maestro':
return 'MAE';
case 'amex':
return 'AMX';
default:
return '<Invalid card type>';
}
}
Тест:
echo GetPaymentMethod( 'visa' ); // VSA