I am new to php arrays and struggling to get my head around how to parse data from them. I have had a look at How can I access an array/object?
but is just beyond my grasp. Need an example to understand. So i have this array in a $result variable
Array
(
[response] => Array
(
[data] => Array
(
[0] => Array
(
[fieldData] => Array
(
[CURRENT_PRIVILEGESET] => FM Data API
)
[portalData] => Array
(
)
[recordId] => 1
[modId] => 0
)
[1] => Array
(
[fieldData] => Array
(
[CURRENT_PRIVILEGESET] => FM Data API
)
[portalData] => Array
(
)
[recordId] => 2
[modId] => 0
)
)
)
[messages] => Array
(
[0] => Array
(
[code] => 0
[message] => OK
)
)
)
How do i get the value for [CURRENT_PRIVILEGESET]? I have tried the below but i think i have misunderstood something. Thanks all for your patience while i try to get to grips with this.
$privilege = $result["response"]['data'][0]->fielddata["CURRENT_PRIVILEGESET"];