Ternary operator and string concatenation quirk?

$description = 'Paper: ' . ($paperType == 'bond' ? 'Bond' : 'Other');

Try adding parentheses so the string is concatenated to a string in the right order.

Leave a Comment