Using XML node names with hyphens in PHP [duplicate]

From PHP manual:

Accessing elements within an XML document that contain characters not permitted under PHP’s naming convention (e.g. the hyphen) can be accomplished by encapsulating the element name within braces and the apostrophe.

In your case you do:

$xml->{'custom-field-value'}

Leave a Comment