$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/