I am trying to decode a json data set with many entires that have the same names but are paired with multiple different values.
Example:
{"id":"XXX",
"price":"XXX",
"size":"XXX",
"id":"YYY",
"price":"YYY",
"size":"YYY"}
I have no problem building an array when there is only one value for each name by doing this:
$array = json_decode($array4,true);
PHP array:
array(3) {
["id"]=> string(3) "XXX"
["price"]=> string(3) "XXX"
["size"]=> string(3) "XXX"
}
but when I try to use the whole file which contents ~4000 different values with paired between ~4 names I get a response of NULL when I want the json_decode to be something like:
array(3) {
["id"]=> string(3) ("XXX","YYY")
["price"]=> string(3) ("XXX","YYY")
["size"]=> string(3) ("XXX","YYY")
}
Can anyone help?