-2

I have a JSON output on PHP like:

[{"Title":"Message","count":"180","Number":"200"},
 {"Title":"Message","count":"200","Number":"400"}]

How can I obtain a result like the following?

[{"Title":"Message","count":"380","Number":"600"}]
jotik
  • 17,044
  • 13
  • 58
  • 123
Ratoj
  • 1
  • 1
  • How to implement it in php code please??i am a begining programmer – Ratoj May 03 '16 at 09:00
  • Possible duplicate of [Merging two json in PHP](http://stackoverflow.com/questions/20286208/merging-two-json-in-php/20286594#20286594) – Ani Menon May 03 '16 at 09:07

1 Answers1

0

In php:

json_encode(array_merge(json_decode($a, true),json_decode($b, true)))

Refer : example

Community
  • 1
  • 1
Ani Menon
  • 27,209
  • 16
  • 105
  • 126
  • Thank you for your repons but it return still duplicate value, I would like grouping by "Message" and make sum to "count" and "number" – Ratoj May 03 '16 at 09:14