开发者

Shorter/cleaner code ternary statement

开发者 https://www.devze.com 2023-02-07 05:17 出处:网络
Is there a shorter, cleaner way to write this? <?php $a = ($a) ? $a : \'e开发者_高级运维mpty\'; ?>

Is there a shorter, cleaner way to write this?

<?php $a = ($a) ? $a : 'e开发者_高级运维mpty'; ?>


In php5.3

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

精彩评论

暂无评论...
验证码 换一张
取 消