Does the ternary handle multiple conditions? or is only for single contidional statements.
ie: I know this is legal
Code: Select all
$firstname = (isset($_POST['fname'])) ? $_POST['fname'] : -1;
do multiple conditions work?
Code: Select all
$firstname = (isset($_POST['fname']) && ereg("^[a-zA-Z]+$", $_POST['fname'])) ? $_POST['fname'] : -1;
Reason for my asking is that I'm lazy

. I already have series of ternary statements with single conditions and I don't feel like changing them to full blown 'if' statements, but I will if ternary operators don't handle multiple conditions.
As always, laziness breeds innovations & new thinking
