How remove and reindex arrays duplicate by comparing spécific values source and target?
Sample array to process:
Array
(
[links] => Array
(
[0] => Array
(
[source] => galaxy
[target] => s7
[value] => 1
)
[1] => Array
(
[source] => galaxy
[target] => s7
[value] => 1
)
[2] => Array
(
[source] => s7
[target] => galaxy
[value] => 1
)
[3] => Array
(
[source] => galaxy
[target] => s8
[value] => 1
)
)
)
Desired result:
Array
(
[links] => Array
(
[0] => Array
(
[source] => galaxy
[target] => s7
[value] => 1
)
[1] => Array
(
[source] => s7
[target] => galaxy
[value] => 1
)
[2] => Array
(
[source] => galaxy
[target] => s8
[value] => 1
)
)
)
Thank's