I次の配列を持つ関連するアレイ内の各キーから一つの値をフェッチ
array(
'messages' => array(
0 => array(
'id' => '3',
'subject' => 'what did you say last night?',
'message' => 'your mother wai',
'from' => '13',
'to' => '1',
'from_viewed' => '0',
'to_viewed' => '0',
'from_deleted' => '0',
'to_deleted' => '0',
'from_vdate' => NULL,
'to_vdate' => NULL,
'from_ddate' => NULL,
'to_ddate' => NULL,
'created' => '2016-05-14 14:02:12',
) ,
1 => array(
'id' => '2',
'subject' => 'this is new',
'message' => 'hello guy',
'from' => '11',
'to' => '1',
'from_viewed' => '0',
'to_viewed' => '0',
'from_deleted' => '0',
'to_deleted' => '0',
'from_vdate' => NULL,
'to_vdate' => NULL,
'from_ddate' => NULL,
'to_ddate' => NULL,
'created' => '2016-05-14 13:59:56',
) ,
2 => array(
'id' => '1',
'subject' => 'hello boy.',
'message' => 'i love this too much . what do you think about making this happen for tomorrow? already then . good bye',
'from' => '11',
'to' => '1',
'from_viewed' => '0',
'to_viewed' => '0',
'from_deleted' => '0',
'to_deleted' => '0',
'from_vdate' => NULL,
'to_vdate' => NULL,
'from_ddate' => NULL,
'to_ddate' => NULL,
'created' => '2016-05-14 13:54:02',
) ,
) ,
)
私がやりたいすべてが、この場合は、アレイ内のすべてのキーの値(「から」それは取ることです - 13,11,11)、それらをデータベースに送信して、コードネイターで名前やアバターなどの情報を取得します。
UPDATE
Iは次のようにしようと、ITは、(バックでカンマで)、MEを11,11,13を与えました。
$from = $messages['messages'];
for ($col = 0; $col < 3; $col++) {
echo $messages['messages'][$col]['from'].",";
}
さらに、いくつの値をエコーする必要があるか判断したくありません。私はそれが存在する限りエコーするようにしたい。
ここに 'var_dump()'配列を入れてください。 –