php if switch语句吗,PHP If / ELSE或Switch / Case语句

我给出的输入可以是1或0

$no_required

$on_arrival

$schengen_visa

$uk_visa

$usa_visa

我有以下案例,我想要显示唯一的消息给用户每一个

a b c d e

1 0 0 0 0 No Visa Required

0 1 0 0 0 Visa can be obtained on Arrival

0 0 1 0 0 You need Schengen Visa

0 0 0 1 0 You need UK visa

0 0 0 0 1 You need US visa

0 0 1 1 1 You need Either of the Visas

0 0 1 1 0 You need Schengen/UK visa

0 0 1 0 1 You need Schengen/US visa

0 0 0 1 1 You need USA/UK visa

其中A B C D E F是上述变量.哪种是显示结果的最佳和优化的方法.

你可能感兴趣的:(php,if,switch语句吗)