我怎样才能为每个人制作if语句? [英] How Can I make my if statement to be for each individual ?

查看:83
本文介绍了我怎样才能为每个人制作if语句?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

if(isset($_POST['submit']))
{
  if(!empty($_POST['value1'] && $_POST['value2'] && $_POST['value3']))
  {
     //do something
  }
  elseif(!empty($_POST['value1'] && $_POST['value2']))
  {
     //do something (value 3 must not be posted***!)
  }
  elseif(!empty($_POST['value1']))
  {
     // do something (value 2 and 3 must not be posted***!)  
  }
}



我上面的代码......它可能是错误的,它可以选择3 if语句而我需要它只选择其中一个3,我能写得更简单吗?我发布一个复选框值使用POST metod ...谢谢!


Hi , my code above ... its probably wrong and the fact that it can pick the 3 if statements while I need it to pick only one of the 3 and can I write it any simpler ? Im posting a checkboxes value Using POST metod ... thanks!

推荐答案

_POST [' 提交']))
{
if(!empty(
_POST['submit'])) { if(!empty(


_POST [' value1']&&
_POST['value1'] &&


_POST [' value2']&&
_POST['value2'] &&


这篇关于我怎样才能为每个人制作if语句?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆