{$b?’yes’:’no’} !empty($b) ? ‘yes’ : ‘no’; {$b??’默认值’} isset($b) ? htmlentities($b) : ‘默认值’; {$b?=’默认值1’} if(!empty($b)) echo ‘默认值1’; {$b?:’默认值2’} !empty($b) ? htmlentities($b) : ‘默认值2’; {$b > 1?’yes’:’no’} $b>1 ? ‘yes’ : ‘no’;