php - How can I merge or search an object? -
This is my problem:
I have an orange orange that looks like this. Need to find objects matching with matching id, as if there is no such way without which there is a foreach? There are many and I do not want to loop on the whole item every time I must It looks like the end. I'm not sure that it has any meaning, this is the reason that I will have two bizarre outputs in one It's all coming from a huge Jason object and I'm using it as Do I have to type the Note: the input json can not be changed, I have no relation with those who have made it. Create an array with the key in the form of first loop and ID on your input array You can then create your second array by searching the ID on the array key [37633 9] = & gt; Array ([0] = & gt; 1f422730-f54b-4e4d-9289-10258ce74446 [1] = 60dc4646-06ce-44d0-abe9-ee371847f4df)
stdClass object ([id] = & gt; 1f422730-f54b-4e4d-9289-10258ce74446 [percent] = & Gt; 32 [Destinations] = & gt; Array ([0] => Study Class Object ([ID] => 59826 [destination_id] => 59826 [type] => Destination [ Dequeue] => [value] => xxxxxxxxxxx)) stdClass object ([id] => 60dc4646-06ce-44d0-abe9-ee371847f4df [percent] => 68 [destinations] = & gt; ; Array ([0] = & gt; stdClass object ([ID] => 60046 [destination_id] => 60046 [type] => destination [dequeue] => [value] => gt; ; Xxxxxxxxxxxx))
[37633 9] = & gt; Array ([0] = & gt; array ([id] = & gt; 1f422730-f54b-4e4d-9289-10258ce74446 [percent] => 32 [places] => array ([0] = & gt; ; [StdClass object] ([id] = & gt; 59826 [destination_id] => 59826 [type] => destination [duplication] => [value] => xxxxxxxxxxx)) [1] = & Gt; array ([id] = & gt; 60dc4646-06ce-44d0-abe9-ee371847f4df [percent] = & gt; 68 [places] => array ([0] => stdClass object ([id ] = & Gt; 60046 [destination_id] => 60046 [type] = Destination [dequeue] => [value] => xxxxxxxxxxxx))
json_decode ($ jsonstuff) .
True, then it would be easy? If I can do this only in Ajnant, then it will be clear but as it is, I am at a loss, the way I need to output.
$ input = json_decode ($ json_input); $ Output = array (); Forex Currency ($ input $ obj) {$ Output [$ obj- & gt; ID] = $ obj; }
$ massive_search_array = array (376339 => array (0 = & Gt; 1f422730-f54b-4e4d-9289-10258ce74446, 1 = & gt; 60dc4646-06ce-44d0-abe9-ee371847f4df)); $ End_output = array (); ($ $ [$ Search]) {$ end_output [$ index] [] = $ output [$ search] ($ $ $ [search])]; }}}
Comments
Post a Comment