亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何從多維數組制作一個好的 html 表示表?

如何從多維數組制作一個好的 html 表示表?

PHP
慕容森 2021-07-02 09:52:34
我需要使用維度數組將我的數據庫結果轉換為一個漂亮的 HTML 表。我知道這是一個非常有條件的情況。我正在使用 CodeIgniter 并且已經有了一些數據。我試圖提取數據庫結果并制作新的數組格式?,F在我對如何將它很好地格式化為 HTML 表格感到困惑。$schedule = [];foreach($this->data['jadwal_kelas'] AS $row){  $schedule['class_name'][$row->class_name]['time'][$row->start.'-'.$row->end] = ['room' => $row->room, 'mentor_code' => $row->mentor_code];}這里的結果使用 print_r<pre>Array(    [class_name] => Array        (            [E-1] => Array                (                    [time] => Array                        (                            [07:30:00-08:30:00] => Array                                (                                    [room] => A                                    [mentor_code] => TPA-1                                )                            [08:30:00-09:30:00] => Array                                (                                    [room] => A                                    [mentor_code] => TPA-1                                )                            [10:00:00-11:00:00] => Array                                (                                    [room] => A                                    [mentor_code] => FIS-1                                )                            [11:00:00-12:00:00] => Array                                (                                    [room] => A                                    [mentor_code] => FIS-1                                )                        )                )我不知道如何loop通過數組來創建像上面這樣的表。如果這里有人能指出我正確的方向,將不勝感激。謝謝你。
查看完整描述

2 回答

  • 2 回答
  • 0 關注
  • 206 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號