I have two multidimensional array and I want to change array element position based on second array. I have never done this way so no idea how to do this with array. Here I am posting my array result.
First(main) array:
Array
(
[0] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1201
)
[1] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1200
)
[2] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1196
)
[3] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1193
)
[4] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1191
)
[5] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1145
)
[6] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1144
)
[7] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1139
)
[8] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1135
)
[9] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1053
)
)
Second array:
Array
(
[0] => stdClass Object
(
[bounced_id] => 2
[user_id] => 156
[property_id] => 1193
)
[1] => stdClass Object
(
[bounced_id] => 1
[user_id] => 156
[property_id] => 1191
)
[2] => stdClass Object
(
[bounced_id] => 26
[user_id] => 156
[property_id] => 1200
)
)
I want this array results:
Array
(
[0] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1193
)
[1] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1191
)
[2] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1200
)
[3] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1201
)
[4] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1196
)
[5] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1145
)
[6] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1144
)
[7] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1139
)
[8] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1135
)
[9] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1053
)
)