Reputation: 5663
Is there a shorter, cleaner way to write this?
<?php $a = ($a) ? $a : 'empty'; ?>
Upvotes: 1
Views: 94
Reputation: 32145
In php5.3
<?php $a = ($a) ?: 'empty'; ?>
Upvotes: 6