Accessing properties
Last updated
Was this helpful?
Last updated
Was this helpful?
We use Symfony's component to help read and write data.
To access array properties use the index notation, specifying array keys within square brackets.
Access $data['name']
:
Access $data['people']['name']
:
Access $data['people']['categories'][0]
:
To access object properties use the dot notation, specifying object properties separated by a dot character.
Access $data->name
:
Access $data->people->name
:
Access $data->people->categories[0]
: