值我在我的控制器下面一行:越來越陣列關鍵的笨
$data['faq'] = $this->faqModel->get();
此數據印刷使用的print_r
Array
(
[faq] => Array
(
[0] => Array
(
[faqid] => 12
[catid] => 122
[question] => How this CMS works
[question_en] => How this CMS works
[answer] => How this CMS works?
[answer_en] => How this CMS works?
[sorder] => 2
[visible] => 1
)
[1] => Array
(
[faqid] => 8
[catid] => 121
[question] => How does the design cost?
[question_en] => How does the design cost?
[answer] => How does the design cost?
[answer_en] => How does the design cost?
[sorder] => 1
[visible] => 1
)
)
)
我想使用存儲在值以下[catid]鍵,我試圖做這樣的事情: $ data ['faq'] ['catid']在控制器中獲取該值(我想再次使用該值進行選擇)但是我得到與此錯誤消息:未定義的索引:catid
任何人都可以幫助我獲得['catid']的價值?
問候,卓然
你缺少前CATID $數據指數[ '常見問題解答'] [0] [ 'CATID'] – arma 2012-03-19 10:11:04
感謝ARMA,它現在的作品。 – Zoran 2012-03-19 10:26:26