There are five arrays for array loop judgment (currently only three groups are listed, and the obtained arrays are arrays of less than five): array (0 & gt; array (oldyear & nbsp; & gt; & nbsp; 10, powerFlag & nbsp; & gt; & nbsp; 1, powerCredit & nbsp; & gt; & nbsp; not good), 1 & gt; array (oldyear: array loop judgment
There are five arrays (currently, only three groups are listed, and the obtained arrays are arrays of less than five ):
Array (
0 => array ("oldyear" => "10", "powerFlag" => "1", "powerCredit" => "not good "),
1 => array ("oldyear" => "30", "powerFlag" => "0", "powerCredit" => "Good "),
2 => array ("oldyear" => "80", "powerFlag" => "1", "powerCredit" => "Good ")
.....
)
/*
// Oldyear age
// Whether the powerFlag is signed
// PowerFlag credit
// Credit: If any of the five right holders does not select a good credit condition, the fee is automatically shown as 2.0
// Elderly: if one of the five rights holders selects the elderly or minor (<18 is minor,> 60 is elderly), the failure is automatically displayed.
// Present signature: if either of the five rights holders chooses to sign the event (the number can be 1, and the number cannot be 0), the event fails to be displayed automatically.
I have been thinking for a long time. thank you. thank you very much!
Php array
Share To: array ("oldyear "? =>? "10", "powerFlag "? =>? "1", "powe... 'data-pics =''>
------ Solution --------------------
$ Array = array (
0 => array ("oldyear" => "10", "powerFlag" => "1", "powerCredit" => "not good "),
1 => array ("oldyear" => "30", "powerFlag" => "0", "powerCredit" => "Good "),
2 => array ("oldyear" => "80", "powerFlag" => "1", "powerCredit" => "Good ")
);
$ Find = false;
Foreach ($ array as $ row ){
If ($ row ["oldyear"]> 60
------ Solution --------------------
$ Row ["oldyear"] <18 ){
$ Find = true; // elderly: if one of the five rights holders selects the elderly or minor (<18 is a minor,> 60 is an elderly), the failure is automatically displayed.
}
If ($ row ["powerFlag"] = '0 '){
$ Find = true; // The on-site signature: if one of the five right holders fails to sign (the on-site signature can be set to 1, and the on-site signature cannot be set to 0), the automatic display fails.
}
If ($ row ["powerCredit"] = 'Bad '){
$ Find = true; // credit condition: the credit condition is good for any of the five right holders who do not select a credit.
}
}
If ($ find = false ){
Echo '2. 0'; // automatically displayed as 2.0
} Else {
// Others
}
?>