我知道有讨论连接的主题。 但是,我似乎无法弄清楚这个
有什么问题 $LEVEL0 = "Banned";
$LEVEL1 = "Member";
$LEVEL2 = "Subscriber";
$Level = "LEVEL".$userRow['user_level'];
echo($Level);
它总是只回显$userRow['user_level']
中存储的数字
而不是回应变量本身的值。
答案 0 :(得分:0)
$LEVEL0 = "Banned";
$LEVEL1 = "Member";
$LEVEL2 = "Subscriber";
$Level = "LEVEL" . $userRow['user_level'];
echo $$Level;
答案 1 :(得分:0)
我认为你正在寻找这个:
$LEVEL = array("Banned","Member","Subscriber");
$Levelval = $LEVEL[$userRow['user_level']];
echo $Levelval;
答案 2 :(得分:-1)
试试这个
$LEVEL0 = "Banned";
$LEVEL1 = "Member";
$LEVEL2 = "Subscriber";
$Level = $LEVEL.$userRow['user_level'];
echo $Level;