Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
301 views
in Technique[技术] by (71.8m points)

php - How can you combine two arrays?

They are simplified as follows which is enough for this question. This question is based on this answer.

1

[a][b][]

and

2

[a][c]

where both arrays has one common subarray [a].

I would like to have this

[a][c][b][]

I have run the following command unsuccessfully

array1[a] + array2[a]
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

$array1 = array_merge($array1, $array2);


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...