ThinkPHP3.2.3 foreach嵌套迴圈bug

來源:互聯網
上載者:User

標籤:分享   blog   ima   nbsp   [1]   each   config   logs   迴圈   

有兩個數組authA和authB

authA如下

 1 Array 2 ( 3     [0] => Array 4         ( 5             [auth_id] => 1 6             [auth_name] => 文章管理 7             [auth_pid] => 0 8             [auth_c] =>  9             [auth_a] => 10             [auth_level] => 011         )12 13     [1] => Array14         (15             [auth_id] => 416             [auth_name] => 系統設定17             [auth_pid] => 018             [auth_c] => 19             [auth_a] => 20             [auth_level] => 021         )22 23 )

authB如下

 1 Array 2 ( 3     [0] => Array 4         ( 5             [auth_id] => 2 6             [auth_name] => 文章列表 7             [auth_pid] => 1 8             [auth_c] => Article 9             [auth_a] => index10             [auth_level] => 111         )12 13     [1] => Array14         (15             [auth_id] => 316             [auth_name] => 添加文章17             [auth_pid] => 118             [auth_c] => Article19             [auth_a] => add20             [auth_level] => 121         )22 23     [2] => Array24         (25             [auth_id] => 526             [auth_name] => 網站配置27             [auth_pid] => 428             [auth_c] => Config29             [auth_a] => index30             [auth_level] => 131         )32 33     [3] => Array34         (35             [auth_id] => 636             [auth_name] => 網站備份37             [auth_pid] => 438             [auth_c] => Config39             [auth_a] => bak40             [auth_level] => 141         )42 43 )

正確的迴圈代碼是

 

若是把vv改成authB,則會出現bug

換成其他非authB則不會出現問題

 

ThinkPHP3.2.3 foreach嵌套迴圈bug

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.