First of all, I understand why this is not working, but am not 100% sure on a decent way to fix it within my scenario.
I have 2 arrays, male genetics and female genetics. There's a loop that runs through and pairs them together, here's an example:
'Bell-Albino' => 'Bb'
Problem is, I need to do something like this:
if($gene != 'BB' || $gene != 'RR' || $gene != 'TT'){ echo 'Recessive Albino'; } The conundrum is, if the $gene is BB for example, this will always return 'recessive albino' because the other 2 or statements are being matched.
The array has many key's and this code only needs to run on the above values, hence why I can't do a simple check on if they value is upper case. EE isn't an albino strain, only BB, RR and TT are.
I could do this as an elseif() condition but it would add an extra 10 lines or so and not sure if there is a better way.
||with&&?&&instead of||when using negative condition checks. Can you give an example of theelseifconstruct, then we can see how it can be simplified.