Reputation: 5858
I am currently trying to figure out how to parse this, yet, no solution found.
My problem is that I am getting a object on this way: (this is a console.debug result)
[Object { id=32193, value="user 1"},
Object { id=42203, value="user 3"},
Object { id=41747, value="user 4"} .....]
I tried with this function thinking could be json format
but no result yet.. any idea which is the best way to do it?
THanks
Upvotes: 0
Views: 37
Reputation: 43235
This is a javascript object. To convert it into PHP object, convert this javascript object into a JSON string.
var jsonStr = JSON.stringify(myObj);
// pass this string to PHP,
in PHP use json_decode($jsonStr)
( where $jsonStr is received through GET or POST.
Upvotes: 1