作者为空,则不输出任何内容

<?if($navinfor['writer']==""){echo'';}else{echo'<span>作者:'.$navinfor[writer].'</span>';}?>

或者输出其他

<?if($navinfor['writer']==""){echo'占无作者';}else{echo'<span>作者:'.$navinfor[writer].'</span>';}?>