我有源阵列追加到关联数组?
$A = array(
0=> array(
'title'=>'HTML5+CSS3',
'teacher'=>'jonh',
'id_post'=>1,/* link to $post_formation */
'formation'=>1,
'date'=>'12/12/2112'
)
);
和一个其它阵列:
$post_formation = array(
0=>array(1,2,3),
1=>array(3,4,5)
)
查找范围$A
操纵新restult(在这种情况下id_post=1
1=>array(3,4,5)
所以将包含更多3 elements
)
$result = array(
/* from $A */
0=> array(
'title'=>'HTML5+CSS3',
'teacher'=>'jonh',
'id_post'=>1,
'formation'=>1,
'date'=>'12/12/2112'
),
/* Append here more 03 elements `3,4,5` */
1=> array(
'title'=>'(A)HTML5+CSS3',
'teacher'=>'jonh',
'id_post'=>1,
'formation'=>3,
'date'=>'--/--/---'
),
2=> array(
'title'=>'(A)HTML5+CSS3',
'teacher'=>'jonh',
'id_post'=>1,
'formation'=>4,
'date'=>'--/--/----'
),
3=> array(
'title'=>'(A)HTML5+CSS3',
'teacher'=>'jonh',
'id_post'=>1,
'formation'=>5,
'date'=>'--/--/----'
)
);
任何人都可以告诉我这是怎么回事?
我不太明白逻辑。你有什么尝试,你卡在哪里? – deceze