I have two multidimensional array
// Array 1
Array
(
[0] => Array
(
[src] => /wp-content/uploads/2019/09/heythere.jpg
[source] => database
)
[1] => Array
(
[src] => /wp-content/uploads/2019/09/test.jpg
[source] => database
)
);
// Array 2
Array
(
[0] => Array
(
[src] => /wp-content/uploads/2019/09/heythere.jpg
[source] => directory
)
[1] => Array
(
[src] => /wp-content/uploads/2019/09/demo.jpg
[source] => directory
)
[2] => Array
(
[src] => /wp-content/uploads/2019/09/image.jpg
[source] => directory
)
);
There is similar data in both the arrays like; /wp-content/uploads/2019/09/heythere.jpg
I want to merge these two arrays in one but only unique elements by value also I need to get the element of Array1 if the values are same
So after merging two array I want this result:
Array
(
[0] => Array
(
[src] => /wp-content/uploads/2019/09/demo.jpg
[source] => directory
)
[1] => Array
(
[src] => /wp-content/uploads/2019/09/image.jpg
[source] => directory
)
[2] => Array
(
[src] => /wp-content/uploads/2019/09/heythere.jpg
[source] => database
)
[3] => Array
(
[src] => /wp-content/uploads/2019/09/test.jpg
[source] => database
)
);
It will skip "directory" similar element.