gpt4 book ai didi

php - 看看PHP中触发了什么变量的If语句?

转载 作者:行者123 更新时间:2023-12-03 08:13:31 25 4
gpt4 key购买 nike

$one=$_POST['one'];
$two=$_POST['two'];
$three=$_POST['three'];
$four=$_POST['four'];
$five=$_POST['five'];
$six=$_POST['six'];
$seven=$_POST['seven'];
$eight=$_POST['eight'];
$nine=$_POST['nine'];
$ten=$_POST['ten'];
if ( $one == "gift" or $two == "gift" or $three == "gift" or $four == "gift" or $five == "gift" or $six == "gift" or $seven == "gift" or $eight == "gift" or $nine == "gift" or $ten == "gift" ) {
echo "<meta http-equiv='refresh' content='0; url=./gift.php?item=" . ??? . "' />";
}

我要放什么???填充触发if语句的变量名...

最佳答案

$key = array_search('gift', $_POST);
if ($key) {
echo "$key equals 'gift'";
} else {
echo "nothing equals 'gift'";
}

关于php - 看看PHP中触发了什么变量的If语句?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23833410/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com