【发布时间】:2017-03-07 07:40:19
【问题描述】:
我在我的网站上使用以下声明。我想知道 selected_plan_id 是 4、5 还是 6。我使用的任何 OR 变体都会破坏我的代码。
<?php if($CURRENT_USER['selected_plan_id'] == '5'): ?>
这是我目前尝试过的:
<?php if($CURRENT_USER['selected_plan_id'] == '5' or '4' or '6'): ?>
:(错误
<?php if($CURRENT_USER['selected_plan_id'] == '"5", "4", "6"'): ?>
:(为每个用户显示这个
<?php if($CURRENT_USER['selected_plan_id'] == '5'): or if($CURRENT_USER['selected_plan_id'] == '4'): or if($CURRENT_USER['selected_plan_id'] == '6'): ?>
:(错误
【问题讨论】:
-
我在您的代码中没有看到任何
or。 -
向我们展示您尝试了什么以及为什么它们没有工作/您遇到了什么错误。
-
具体问题!
标签: php if-statement