数组显示在表中

时间:2016-05-01 11:00:40

标签: php codeigniter

我只需要在表格列(位置)中显示arracy搜索的值,如何消除空列。我需要键才能显示在表格的位置列中

All values should be displayed in 'Position' column

<?php
    $subject_mark = $this->crud_model->get_subject_mark($row2['exam_id'], $class_id, $row3['subject_id'], $row1['student_id']);

    $subj_pos = $this->crud_model->get_subject_position($row2['exam_id'], $class_id, $row3['subject_id']);


    foreach($subj_pos as $key => $row){
        $subject_pos = $row['mark_obtained'];
        $array = array($key+=1 => $subject_pos);
        $result = array_search($subject_mark['mark_obtained'], $array);
?>
     <td style="text-align: center;"><?php echo $result; ?></td>
    <?php }?>

0 个答案:

没有答案