Skip to content
Advertisement

Add JSON keys/values while creating another JSON PHP

I am trying to pass some JSON keys/values that I have to another JSON I am creating dynamically.

For example, this is the JSON I have in $json_create

JavaScript

That comes over file_get_contents

JavaScript

And this is the JSON I am creating

JavaScript

Which print something like

JavaScript

What I am trying to achieve is

JavaScript

There is quite a lot on that subject but somehow I could not succeed in implementing it.

Advertisement

Answer

JavaScript

output

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