我很困惑。这么简单的事情。它只是不会“elseif”不能让elseif工作
我需要的是这样的:<?php if ($pscorelabel >= 21) : ?>
做某事这样做:<?php if ($pscorelabel >= 42) : ?>
做别的。
我附上了代码片段。请,我是一个小白菜,需要你的帮助。任何帮助将不胜感激。
<?php if ($showscore == '1') : ?>
<div class="ipt_fsqm_up_number">
<h6>
<?php $ui->print_icon_by_class('quill', false); ?>
<?php printf(__('%2$s%% Average %1$s', 'ipt_fsqm'), $scorelabel, number_format_i18n(($avg_score * 100), 0)); ?>
</h6>
<?php endif; ?>
<?php if ($pscorelabel >= 21) : ?> <div class="ipt_fsqm_up_meta">
<h6><?php $ui->print_icon_by_class('quill', false); ?>
<?php printf(__('%2$s Total CPD Points %1$s', 'ipt_fsqm'), $finallabel, number_format_i18n(($pscorelabel * 1), 0)); ?>
</h6>
<?php elseif ($pscorelabel >= 42) : ?>
<div class="ipt_fsqm_up_meta">
<h6><?php $ui->print_icon_by_class('quill', false); ?>
<?php printf(__('%2$s Total CPD Points %1$s', 'ipt_fsqm'), $finallabel, number_format_i18n($finallabel = 6, 0)); ?>
</h6>
<?php endif; ?>
请正确格式化你的代码。 – Wavemaster
首先摆脱结合标记和逻辑;) –
使用非becaketed如果/然后语句与HTML中断可能导致问题,您的代码首先需要一些清理。下面的答案是正确的,你的42和21是交换的,因为第二个真实的条件会在第一个真实的,第二个永远不会达到。如果你想要两个eval单独忽略其他如果为正常如果。 – Wobbles