I have a json string
{
"to": {
"data": [
{
"name": "f8",
"id": "11204705797"
},
{
"name": "f9",
"id": "11205705797"
}
]
}
}
and I need to replicate it in php, what I have is a array of name&id’s like this
Array
(
[friends] => Array
(
[0] => 939394934-Steve
[1] => 939394934-Steve
[2] => 939394934-Steve
[3] => 939394934-Steve
)
)
and I would explode by – to get id-name
How can I do this?
If I understand correctly, you want something like this: