Note Submitter: [email]kari_hre@hotmail.com[/email]

----

The ternary operator with many conditions has always confused me so I sat down and played with it for a while. Here are the results.

This:
echo ($var1 == 1) ? ($var2 == 2) ? ($var3 == 3) ? 'a' : 'b' : 'c' : 'd';

works just as:
if ($var1 == 1) {
if ($var2 == 2) {
if ($var3 == 3) {
echo 'a';
} else {
echo 'b';
}
} else {
echo 'c';
}
} else {
echo 'd';
}

Hope this will clear up some confusion!