array(2) {
[0]=>
int(2)
[1]=>
int(1)
}
How to assemble the above array into the following array corresponding to the value [0]=>
int(2) [1]=>
int(1) as a column of g_num
Assemble arrays in sequence
array(2) {
[0]=>
array(14) {
["id"]=>
string(1) "7"
["m_id"]=>
string(1) "1"
["g_name"]=>
string(6) "苹果"
}
[1]=>
array(14) {
["id"]=>
string(1) "8"
["m_id"]=>
string(1) "1"
["g_name"]=>
string(6) "梨子"
}
}
After the transformation, it looks like this. Thank you, God
array(2) {
[0]=>
array(14) {
["id"]=>
string(1) "7"
["m_id"]=>
string(1) "1"
["g_name"]=>
string(6) "苹果"
["g_num"]=>
string(1) "2"
}
[1]=>
array(14) {
["id"]=>
string(1) "8"
["m_id"]=>
string(1) "1"
["g_name"]=>
string(6) "梨子"
["g_num"]=>
string(1) "1"
}
}
Thanks for the invitation!