PHP 中 快捷的三元运算...

 a!=null ? a: 123

当 a 不为空时,返回 123,

可简写为 a ?: 123(a 不为null 不为 '','0',0 时,返回它本身,否则返回123...) 

猜你喜欢

转载自www.cnblogs.com/whm-blog/p/9197313.html