I have some strings, the format like this
name=bob&age=10&sex=male&weight=80&...
And I want to convert it to json format
{
"name":"bob",
"age":"10",
"sex":"male",
"weight":"80",
//and more
}
I wrote some codes, but I don't know how to continue
$co="name=bob&age=10&sex=male&weight=80&...";
$toarray = explode("&", $co);
Does someone give some tips? Many thanks.