php和html代码的组合在除最后一个li标记之外的所有li标记中都有error - in hr标记

这是我的代码:

$output .=
'<li class="recentcomments recent-comment">
    <div class="wbrc-header">
    <span class="wbrc-header-avatar">' . get_avatar( $comment, 50/*avatar_size*/ ) . '</span>
    <div class="wbrc-header-AD">
    <span class="wbrc-header-author">' . $author . '</span>
    <span class="wbrc-header-date">' . $date . '</span>
    </div>
    </div>
    <div class="wbrc-body">
    <span class="wbrc-body-comment">' . $comment_text . '</span>
    </div>'.

    if( ($key + 1) != $comments->count() ) {
    echo '<hr>';
    } .
'</li>';

在这一行中-我想在所有的"li tag“中添加"hr tag”-除了最后一个li -但是这一行有错误-我必须做什么?

if( ($key + 1) != $comments->count() ) {
    echo '<hr>';
}

转载请注明出处:http://www.xingnongyuan.com/article/20230513/2285664.html