I have arrays that looks like this:
Array ( [multi_YTnsPrfuB832.jpg] => gray [multi_hUORaTux1bI.jpg] => episode [multi_Ijtxz4U0iaq_.jpg] => fidgetq [multi_m0QWCyfVjDKh.jpg] => fidget2 )
the data inside the bracket is a URL and the value is the name. I want to encode this to be a json data to be something like this:
{ "offers":
{
"url":multi_YTnsPrfuB832.jpg,
"name":"gray"
},
{
"url":multi_hUORaTux1bI.jpg,
"name":"episode"
},
{
"url":multi_Ijtxz4U0iaq_.jpg,
"name":"fidgetq"
},
{
"url":multi_m0QWCyfVjDKh.jpg,
"name":"fidget2"
}
}
I'm fairly new to json so if someone has an idea how to implement this using php. Thanks!