Skip to content

Instantly share code, notes, and snippets.

@johanbrook
Created September 10, 2011 12:34
Show Gist options
  • Select an option

  • Save johanbrook/1208257 to your computer and use it in GitHub Desktop.

Select an option

Save johanbrook/1208257 to your computer and use it in GitHub Desktop.
<app id="1">
<name>Blah</name>
<price locale="sv">19,31</price>
<price locale="no">16,39</price>
<price locale="da">15,65</price>
<price locale="all">2.12</price>
</app>
Output:
SimpleXMLElement Object(
[name] => Blah
[price] => Array
(
[0] => 19,31
[1] => 16,39
[2] => 15,65
[3] => 2.12
)
)
I want something like this:
SimpleXMLElement Object(
[name] => Blah
[price] => Array
(
[sv] => 19,31
[no] => 16,39
[da] => 15,65
[all] => 2.12
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment