How to get the value of a key within an nested object array PHP

one text

Solution:

You start out with an array with only one object. To call this object you can use:

$nameVar[0]

Then we have an object. You can not use '[]' for objects in PHP. Use '->' to get the value of properties of an object:

$nameVar[0]->pdfUrl

So if we want the unitprice of the first item we use:

$nameVar[0]->items[0]->unitPrice

Source