Skip to content

Same key problem when generating XML string #29

@chris-peng-1244

Description

@chris-peng-1244

Say I want a XML like this

<Books>
 <Book>
  <Title>Book1</Title>
  <Price>10.00</Price>
 </Book>
 <Book>
  <Title>Book2</Title>
  <Price>15.00</Price>
 </Book>
</Books>

Here is the problem, how to feed a xml formatter a correct input array like

[
  'books' => [
    'book' => [
       'title' => 'book1',
       'price' => 10.00,
    ],
    'book' => [
      'title' => 'book2',
      'price' => 15.00,
    ]
]

You can't have same keys in an array! I really don't know what to do, please help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions