Skip to content
Advertisement

How do I include one JSON in another JSON?

My first JSON is:

JavaScript

This will come from a java URL, here I am using PHP, in PHP I am calling a java URL.

My Second JSON is:

JavaScript

I am generating this using JQuery. How can I include the second JSON into the first JSON criterias?

Advertisement

Answer

You need to convert your first JSON string to object and add a new property to it.

If it is Java, you can use Google’s Gson library

JavaScript

If it is JavaScript,

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement