forum

Home / DeveloperSection / Forums / php array merge and convert to json

php array merge and convert to json

Manoj Bhatt316802-May-2013
Hi Expert!

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

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

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

Thanks!

Updated on 02-May-2013

Can you answer this question?


Answer

1 Answers

Liked By