xml
1array(3) { 2 [0]=> 3 object(Record)#3 (3) { 4 ["seq"]=> 5 string(1) "1" 6 ["id"]=> 7 string(7) "test123" 8 ["code"]=> 9 string(5) "11111" 10 } 11 [1]=> 12 object(Record)#2 (3) { 13 ["seq"]=> 14 string(1) "2" 15 ["id"]=> 16 string(7) "test223" 17 ["code"]=> 18 string(5) "12111" 19 } 20 [2]=> 21 object(Record)#1 (3) { 22 ["seq"]=> 23 string(1) "3" 24 ["id"]=> 25 string(7) "test123" 26 ["code"]=> 27 string(5) "11311" 28 }
のような配列データ($listの中身)があります。
この配列($list)の「id」を取得したく思います。
$test_list[0]['id']
$test_list[1]['id']
$test_list[2]['id']
として値を取得したく下記のようにプログラム作成したのですが
値が入ってきません。
php
1foreach ($list as $k => $v) { 2 $test_list[] = array( 3 'id' => get_array_value('id', $v), 4 ); 5}
どのようにしたらいいかご教授いただきたく宜しくお願いします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/11/23 03:28