I am currently trying to order an array based on the value of another array. The values are unique. I seen examples of how to order an array based on the keys of another array but I cant seem to find one that specifically orders an array by the value of another array. Both arrays have the same values. One array has an additional key id
. How could I achieve that?
Array to follow order:
Array
(
[0] => Array
(
[src] => 2GK2VWE-ax--0
)
[1] => Array
(
[src] => 13KXEXyJaM9-0
)
[2] => Array
(
[src] => 138XELryjM9-0
)
)
Array to order:
Array
(
[0] => Array
(
[src] => 13KXEXyJaM9-0
[id] => 123468
)
[1] => Array
(
[src] => 138XELryjM9-0
[id] => 15784239
)
[2] => Array
(
[src] => 2GK2VWE-ax--0
[id] => 12558456
)
)
Desired order:
Array
(
[0] => Array
(
[src] => 2GK2VWE-ax--0
[id] => 12558456
)
[1] => Array
(
[src] => 13KXEXyJaM9-0
[id] => 123468
)
[2] => Array
(
[src] => 138XELryjM9-0
[id] => 15784239
)
)