is it possible to merge 2 arrays without overlapping the same keys ?
I want it to add a new item if a key already exists.
Like that
$a = array(1,2,3,4);
$b = array(3,4,5,6);
merge $a and $b
desired result is
array(1,2,3,4,3,4,5,6)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use array_merge
Working example here
This is the key phrase from the help :
So this will only work when you have numeric keys