1

有没有更短、更简洁的方法来写这个?

<?php $a = ($a) ? $a : 'empty'; ?>
4

1 回答 1

6

在 php5.3

<?php $a = ($a) ?: 'empty'; ?>
于 2011-01-29T20:42:02.953 回答