Hi all
Just a quick question, I have avoided the ternary operator type If statement a lot in my code, because personally I find it easier to read a statement like this:
if (empty($_POST['action'])) {
$action = 'default';
} else {
$action = $_POST['action'];
}
Rather than:
$action = (empty($_POST['action'])) ? 'default' : $_POST['action'];
My question is: Is there any advantage to using the Ternary operator over a standard IF statement other than obviously saving a few characters...