将 $x 显示为未定义。我的 switch 语句有什么问题?
http://localhost/add.php?price_error=1
switch(isset($_GET['price_error']) && $_GET['price_error'] == $x){
case 1:
echo '<span class="error_msg">Discount price cannot be greater than original price</span><br/>';
break;
case 2:
echo '<span class="error_msg">Discount cannot be less than 30% of original price</span><br/>';
break;
case 3:
echo '<span class="error_msg">Discount price and original price cannot be greater than $30000 HKD</span><br/>';
break;
default:
false;
break;
}