Push to array | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Push to array

Hello. I need to push data from one array to another, but if first array has two identical values, it shouldnt be added. $arr1 = [ [ ‘date’ => ‘november’, visits: ‘140’], [ ‘date’ => ‘oktober’, visits: ‘120’], [ ‘date’ => ‘november’, visits: ‘96’], ]; The second array should be : $arr2 = [ [ ‘date’ => ‘november’, visits: ‘140’], [ ‘date’ => ‘oktober’, visits: ‘120’], ];

16th Nov 2023, 8:21 PM
Nadezda Tarassova
1 Answer
+ 2
Can you share what you've tried?
20th Nov 2023, 2:21 AM
Steve
Steve - avatar