i have an array like this
array 1
array(3) {
[0]=> string(2) "47"
[1]=> string(2) "48"
[2]=> string(2) "49"
}
i have plan to giving array with name, the array name is number
array 2
array(3) {
[0]=> object(stdClass)#18 (2) {
["address"]=> string(9) "Address 1"
["price"]=> string(16) "120000" }
[1]=> object(stdClass)#21 (2) {
["address"]=> string(9) "Address 2"
["price"]=> string(16) "150000" }
[2]=> object(stdClass)#20 (2) {
["address"]=> string(9) "Address 3"
["price"]=> string(16) "180000" }
}
I want to inserting array 1 into array 2 which same array key
I want to insert array 1 data into array 2 accordance with the key array . so i I was expecting to be joined both of arrays and became joined array like this
array(3) {
[0]=> object(stdClass)#18 (2) {
["address"]=> string(9) "Address 1"
["price"]=> string(16) "120000"
["number"]=> string(2) "47" }
[1]=> object(stdClass)#21 (2) {
["address"]=> string(9) "Address 2"
["price"]=> string(16) "150000"
["number"]=> string(2) "48"}
[2]=> object(stdClass)#20 (2) {
["address"]=> string(9) "Address 3"
["price"]=> string(16) "180000"
["number"]=> string(2) "49"}
}
is there any way to create or manipulate into an array like that ? my array is dynamically so number of array can be changed anytime.
I would greatly appreciate it if you could help me