帝国cmsphp判断字段值是否为空并且字段值a=字段值b而显示不同的内容

老巴夺 158 0
<?php if(!empty($navinfor[yi] and $navinfor[yi] != $navinfor[newstext])):?>
<a class="translate">译</a>
<?php endif;?>
<?php if($navinfor[yi] != '' and $navinfor[yi] != $navinfor[newstext]){?>
<a class="translate">译</a>
<?}else{?>
<?}?>
两种写法都可