[FX.php List] Referencing output from fmresultset when element names contain hyphens

Malcolm Fitzgerald malcolm at notyourhomework.net
Mon May 11 14:19:48 MDT 2015

[ not strictly an FX question ]

I've just fired a query at FMS requesting a reply in the fmresultset 
grammar and I'm using SimpleXML to handle the result. I dump everything 
into a variable called $fmresultset.

This is fine and works well, until I want to look at the metadata, which 
looks like this.

<field-definition ...
<field-definition ...
<field-definition ...
<field-definition ...

I'd like to use a foreach loop to build a table from the field 
definitions and it should be as simple as this:

foreach ( $fmresultset->metadata->field-definition as $fld )
foreach ( $fmresultset->field-definition as $fld )

Neither works. How do I handle the hyphen?


More information about the FX.php_List mailing list