merge two objects in php
snippet in php

merge two objects in php

user3035

array_merge((array)json_decode($data1), (array) json_decode($data2));