duanfazhun0383 2016-04-25 12:03
浏览 33

无法工作[关闭]

I am so perplexed. Such a simple thing. It just won't "elseif"

All I need is this: <?php if ( $pscorelabel >= 21 ) : ?> does something to do this: <?php if ( $pscorelabel >= 42 ) : ?> does something else.

I have attached the code snippet. PLEASE, I'm such a noob and need your help. Any help will be greatly appreciated.

<?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; ?> 
  • 写回答

1条回答 默认 最新

  • dtutlamjasblef7982 2016-04-25 12:08
    关注

    Update your code, put >42 condition above & then > 21 condition

      <?php 
        if ( $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
    
       } elseif ( $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 } ?> 
    
    评论

报告相同问题?

悬赏问题

  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了
  • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统
  • ¥188 需要修改一个工具,懂得汇编的人来。
  • ¥15 livecharts wpf piechart 属性
  • ¥20 数学建模,尽量用matlab回答,论文格式
  • ¥15 昨天挂载了一下u盘,然后拔了
  • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
  • ¥20 易康econgnition精度验证
  • ¥15 msix packaging tool打包问题