Shorthand if else not working

This works (assuming you’re doing something like an echo or variable assignment that you didn’t show in the example), replacing the “in ↔ out PHP” stuff which IMHO tends to get messy even when it does “work”.

<?php ((empty($_GET['category'])) ? '' : "
	<div class=sidebar>
		<a href='category.php'>Category</a>
	</div>
" ); ?>
2 Likes