var_dump($response);
outputs:
array(1) { ["metafields"]=> array(1) { [13]=> array(10) { ["id"]=> int(32616923206) ["namespace"]=> string(7) "ly26638" } } }
array(1) { ["metafields"]=> array(1) { [13]=> array(10) { ["id"]=> int(32641864774) ["namespace"]=> string(7) "ly26638" } } }
how can I convert $response to an object to operate it like in the following code:
echo $response->metafields[0]->id;
I've tried the code below, but without any result :/
$object = json_decode(json_encode($response));
$response->metafields[0]doesn't exist. Try$response->metafields[13].(object) $array;