我正在嘗試使用帶有“或”的 SWITCH CASE 條件來(lái)獲取從表單收到的一個(gè)或其他值。但總是進(jìn)入第一個(gè)條件“這里!” 1'。有人可以幫我找出代碼中的錯(cuò)誤嗎?我已經(jīng)嘗試使用 [('value1' || 'value2')] 和 ['value1' || 'value'] 兩者都不起作用,因?yàn)榭偸欠祷亍白兞?DDDs 的值是:$sDDDs - 這里!1”<?php$sDDDA = $_POST['DDDA'];$sNumA = $_POST['NumA'];$sDtInit = $_POST['DtInit'];$sDtEnd = $_POST['DtEnd'];$sIdProduct = $_POST['IdProduct'];$sAnoMes = $_POST['AnoMes'];$sDDDs = $_POST['DDDs'];$sMSISDN = $_POST['DDDA'] . $_POST['NumA'];$s55MSISDN = "55" . $_POST['DDDA'] . $_POST['NumA'];echo "The value of the variable DDDA is: $sDDDA <br>";echo "The value of the variable NumA is: $sNumA <br>";echo "The value of the variable DtInit is: $sDtInit <br>";echo "The value of the variable DtEnd is: $sDtEnd <br>";echo "The value of the variable AnoMes is: $sAnoMes <br>";echo "The value of the variable DDDs is: $sDDDs <br>";echo "The value of the variable MSISDN is: $sMSISDN <br>";echo "The value of the variable 55MSISDN is: $s55MSISDN <br>";echo "</b><br><br>";switch($_POST['IdProduct']){case 'Conecta':echo "The value of the variable IdProduct is: $sIdProduct - here! <b>1</b><br><br>"; switch ($_POST['AnoMes']){ case ('ate_201803'||'201804_201902'): echo "The value of the variable AnoMes is: $sAnoMes - here! <b>1</b><br><br>"; switch ($_POST['DDDs']){ case '1x4x5x6x': echo "The value of the variable DDDs is: $sDDDs - here! <b>1 - 1x </b><br><br>"; break; case '2x3x7x8x9x' : echo "The value of the variable DDDs is: $sDDDs - here! <b>1 - 2x </b><br><br>"; break; default: echo 'ERRO! The value is wrong for variable DDD! here! <b>1</b><br><br>'; }
PHP 帶有 or 條件的大小寫切換
達(dá)令說(shuō)
2023-07-21 15:55:41