我有這個代碼,我確定我寫了它正確。但它沒有運行echo函數動作。它只是返回錯誤。PHP的邏輯 - 如果不等於
if(($amount != "250") || ($amount != "500") || ($amount != "750") || ($amount != "1000")){
$error = "You must enter a amount in a multiple of 250.";
error($error);
}elseif(($amount == "250") || ($amount == "500") || ($amount == "750") || ($amount == "1000")){
echo "The logic should display this if i type in 250, 500, 750 or 1000";
}
'如果(($量250%)!= 0)' –
的$金額只能是250,500,750或1000的所有其他款額不得 –
您的代碼沒有任何意義。你應該從邏輯開始。首先,不是(不是||不是b)= a && b'。檢查此:https://en.wikipedia.org/wiki/De_Morgan's_laws – Axalix