Users Pricing

forum

Home Forums php array merge and convert to json – MindStick

php array merge and convert to json

Manoj Bhatt 3536 02 May 2013
Hi Expert!

I have two arrays (below). Is it possible to convert them into json string?

        (
            [0] => size
            [1] => color
        )
Array
        (
            [0] => L
            [1] => Black
        )
Output structure should be:

[
   {"name":"size","value":"L"},
   {"name":"color","value":"Black"}
]

Thanks!

1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md