I am trying to get default value for each field but I just can't figure out how to loop through all the objects. Tried with converting them to a simple array with json_decode but it just not clear as to what to loop.
Here it is:
SimpleXMLElement Object
(
[@attributes] => Array
(
[name] => params
)
[fieldset] => Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[name] => Cat1
)
[field] => SimpleXMLElement Object
(
[@attributes] => Array
(
[name] =>
[type] => list
[default] => 1
)
)
)
[1] => SimpleXMLElement Object
(
[@attributes] => Array
(
[name] => Item2
)
[field] => Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[name] => post1
[type] => text
[default] => 5
)
)
[1] => SimpleXMLElement Object
(
[@attributes] => Array
(
[name] => post2
[type] => text
[default] => 18
)
)
[2] => SimpleXMLElement Object
(
[@attributes] => Array
(
[name] => post3
[type] => text
[default] => 15
)
[option] => Array
(
[0] => Blue
[1] => Green
)
)
)
)
[2] => SimpleXMLElement Object
(
[@attributes] => Array
(
[name] => Cat2
)
[field] => Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[name] => post6
[type] => text
[default] => 3
)
)
[1] => SimpleXMLElement Object
(
[@attributes] => Array
(
[name] => post7
[type] => text
[default] => 36
)
)
[2] => SimpleXMLElement Object
(
[@attributes] => Array
(
[name] => post7
[type] => text
[default] => 88
)
)
)
)
)