To mimick Javascript, I tried this in PHP:
$what == '3' ? ( $tot1 += $sum ; $nLinesProd++ ; )
: ( $tot2 += $sum ; $nLinesExp++; ) ;
I also tried {}
instead of ()
. Neither will work.
Is there a way to use the ternary operator the same way as I do in Javascript?