Skip to content

Export XML to array() or stdClass objects #28

@kinekt4

Description

@kinekt4

It would be nice to be able to export to arrays or stdClass Objects

eg.

$xml = <<<XML
<animal operation="create">
    <type>Herbivore</type>
    <attribute>
      <legs>4</legs>
      <head>1</head>
    </attribute>
</animal>
XML;

// IMPORT
$doc = new FluidXml($xml);
// EXPORT
$arr = $doc->exportArray();
// ARRAY
var_export($arr);

Array (
    'animal' => Array (
      '@operation' => 'create',
      'type' => 'Herbivore',
      'attribute' => Array(
        'legs' => 4,
        'head' => 1
      )
  )
)

Would like to hear if this could be implemented.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions