I need to be able to create an object from an array. The data is coming from a terrible API. Here is an example of the data.
Array
(
[0] => stdClass Object
(
[no] => 1
[FL] => Array
(
[0] => stdClass Object
(
[content] => 1505250000001141005
[val] => ACCOUNTID
)
[1] => stdClass Object
(
[content] => 1505250000000091001
[val] => SMOWNERID
)
[2] => stdClass Object
(
[content] => name here
[val] => Account Owner
)
ETC...
The [no] value is insignificant. the [FL] content is everything I need in the object. So the outcome I would like is all of the values will be variable names and content will be the values. Can anyone suggestion anything to help please?
EDIT I think I need to clarify what I need. I'm creating a class called Account which will hold all the information from the api call in an object. I will instantiate the object then call a method for example valuesFromArray() and pass it the [FL] array given by the api call. it will use [val] as the variable name and [content] as its value.