in reply to concat string with ternary operator

$cl = 'color:' . ($c_diff <= 0 ? $color_good : $color_bad) . ';'; Mind the precedence of operators.

Replies are listed 'Best First'.
Re^2: concat string with ternary operator
by odrevet (Acolyte) on Jul 02, 2011 at 12:55 UTC
    thanks, this worked !