I could really need a help.
json_decode returns NULL.
I get the string from the POST:
$arrayOfItems = $request->getPost()->get('arrayOfItems');
The string looks like this:
'[{id: 161, value1: 1, value2: 1},{id: 162, value1: 2, value2: 2},{id: 163, value1: 3, value2: 3}]'
And I try to get the ids into an array:
$decodedArray = json_decode($arrayOfItems);
$ids = array();
foreach ($decodedArray as $v) {
$ids[] = $v->id;
}
But json_decode returns NULL.
Any help is welcome.
Kind regards rholtermann