で配列のキーの値を取得:私は私のコントローラに次の行持ってCodeIgniterの
$data['faq'] = $this->faqModel->get();
このデータ印刷
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
)
)
)
は、私はに格納された値を使用したいしますprint_rを使用して、次の[catid]キーを押して、私は次のようなことをしようとしています: $ data ['faq'] ['catid']コントローラの値を取得する(その値で別の選択をしたい)しかし、次のエラーメッセージが表示されます。未定義インデックス:catid
['catid']の価値を誰にでも教えてもらえますか?
よろしく、ゾラン
あなたはCATIDの$データの前にインデックス[ 'よくある質問'] [0] [ 'CATID'] – arma
感謝ARMAが欠落している、それが動作するようになりました。 – Zoran