php - Incorrect shorthand if else statement -
i have following ternary operator:
<?php (strcmp($activetab,'profile') == 0 ? echo "active" : ''); ?>
unfortunately not working expected. wish if condition true active
echoed, otherwise nothing.
what doing wrong?
try now
<?php echo (strcmp($activetab,'profile') == 0) ? "active" : ''; ?>
Comments
Post a Comment