I need to calculate points based on boolean selections and I’d like to reduce the amount of code by eliminating the ELSE part of my statements.
Is there anyway to compress this statement down?
...
if ($this->track) {
$trackPTS = 20;
} else {
$trackPTS = 0;
}
...
>Solution :
something like this:
$trackPTS = $this->track ? 20 : 0;