Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/233.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php中包含3个以上变量的真值表_Php_For Loop_If Statement_Checkbox - Fatal编程技术网

php中包含3个以上变量的真值表

php中包含3个以上变量的真值表,php,for-loop,if-statement,checkbox,Php,For Loop,If Statement,Checkbox,大家好 如果我在循环的外侧有3个变量,称为: $atr $ber $cdr 另一个系统将为这3个变量提供2个选项值: 空或不空。 以及循环中的其他3个变量: 每个变量的值来自另一个系统,取决于$i,每个循环将获得不同的值 $aa $bb $cc 现在我的代码是: function SelectAll2() { $arrArraySize = 283; $atr = Empty or not empty.; $ber = Empty or not empty.; $cdr

大家好

如果我在循环的外侧有3个变量,称为:

 $atr
 $ber
 $cdr
另一个系统将为这3个变量提供2个选项值: 空或不空。

以及循环中的其他3个变量: 每个变量的值来自另一个系统,取决于$i,每个循环将获得不同的值

$aa 
$bb 
$cc
现在我的代码是:

function SelectAll2()
{

$arrArraySize = 283;

$atr =  Empty or not empty.;
$ber =  Empty or not empty.; 
$cdr =  Empty or not empty.; 


if($atr=="" && $ber=="" && $cdr==""){ represent 0 0 0
  return 1;
}
elseif($atr=="" && $ber=="" && $cdr!=""){
  for ($i=1; $i<$arrArraySize; $i++)
  {
  $cc = value come from Another system and depend on $i every loop will get diffrent value
    if( $cdr==$cc){ 
    return 1;
    }
  }
}elseif($atr=="" && $ber!="" && $cdr==""){  represent 0 1 0
  for ($i=1; $i<$arrArraySize; $i++)
  {
  $bb = value come from Another system and depend on $i every loop will get diffrent value
    if($ber==$bb){ 
    return 1;
    }
  }  
}elseif($atr!="" && $ber=="" && $cdr==""){  represent 1 0 0
  for ($i=1; $i<$arrArraySize; $i++)
  {
  $aa = value come from Another system and depend on $i every loop will get diffrent value
    if($atr==$aa){ 
    return 1;
    }
  } 
}elseif($atr=="" && $ber!="" && $cdr!=""){   represent 0 1 1
  for ($i=1; $i<$arrArraySize; $i++)
  {
  $bb = value come from Another system and depend on $i every loop will get diffrent value
  $cc = value come from Another system and depend on $i every loop will get diffrent value
    if($ber==$bb && $cdr==$cc){ 
    return 1;
    }
  } 
}elseif($atr!="" && $ber=="" && $cdr!=""){   represent 1 0 1
  for ($i=1; $i<$arrArraySize; $i++)
  {
  $aa = value come from Another system and depend on $i every loop will get diffrent value
  $cc = value come from Another system and depend on $i every loop will get diffrent value
    if($atr==$aa && $cdr==$cc){ 
    return 1;
    }
  } 
}elseif($atr!="" && $ber!="" && $cdr==""){  represent 1 1 0
  for ($i=1; $i<$arrArraySize; $i++)
  {
  $aa = value come from Another system and depend on $i every loop will get diffrent value
  $bb = value come from Another system and depend on $i every loop will get diffrent value
    if($atr==$aa && $ber==$bb){ 
    return 1;
    }
  } 
}else{     represent 1 1 1
  for ($i=1; $i<$arrArraySize; $i++)
  { 
  $aa = value come from Another system and depend on $i every loop will get diffrent value
  $bb = value come from Another system and depend on $i every loop will get diffrent value
  $cc = value come from Another system and depend on $i every loop will get diffrent value
    if($cdr==$cc && $atr==$aa && $ber==$bb){
      return 1;
    } 
  }
}
}
函数SelectAll2()
{
$arraraysize=283;
$atr=空或不空。;
$ber=空或不空。;
$cdr=为空或不为空。;
如果($atr==“”&&$ber==“”&&&$cdr==“”){表示0
返回1;
}
elseif($atr==“”&&$ber==“”&&$cdr!=“”){

对于($i=1;$i),这类问题可能更适合讨论函数的参数不应该是
$atr
$btr
$ctr
?还有什么是“值来自另一个系统,取决于$i”确切地说是什么意思?它只依赖于
$i
,即它是
$i
$i
的函数吗?它只依赖于$i。它可以是参数,它不计量任何功