Click here to Skip to main content
15,915,600 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: PHP Pin
Jeremy Falcon7-Oct-14 9:32
professionalJeremy Falcon7-Oct-14 9:32 
GeneralRe: PHP Pin
Jeremy Falcon7-Oct-14 9:37
professionalJeremy Falcon7-Oct-14 9:37 
GeneralRe: PHP Pin
David O'Neil7-Oct-14 9:48
professionalDavid O'Neil7-Oct-14 9:48 
GeneralRe: PHP Pin
Jeremy Falcon6-Oct-14 10:29
professionalJeremy Falcon6-Oct-14 10:29 
GeneralRe: PHP Pin
Marc Clifton6-Oct-14 10:37
mvaMarc Clifton6-Oct-14 10:37 
GeneralRe: PHP Pin
Jeremy Falcon6-Oct-14 10:44
professionalJeremy Falcon6-Oct-14 10:44 
GeneralRe: PHP Pin
Marc Clifton6-Oct-14 12:38
mvaMarc Clifton6-Oct-14 12:38 
GeneralRe: PHP Pin
Jeremy Falcon6-Oct-14 12:50
professionalJeremy Falcon6-Oct-14 12:50 
Oh you're gonna find some "oddities" in there like that. I totally agree it would make more sense to order it key then value, like when doing a foreach loop.

That being said, there are better ways to traverse an XmlSimpleElement object. Unless it's been properly converted, treating it as a straight array will run into issues, and you'll loose XML metadata attributes, etc.

At the very least, if you're using PHP 5.5, you could do something like this with an anonymous function to at least make it a ton more readable...
PHP
array_walk_recursive($xmlResponse, function($item, $key)
{
    // whatever was in addChild() should go here
});

Jeremy Falcon

GeneralRe: PHP Pin
Marc Clifton6-Oct-14 13:31
mvaMarc Clifton6-Oct-14 13:31 
GeneralRe: PHP Pin
Jeremy Falcon6-Oct-14 13:55
professionalJeremy Falcon6-Oct-14 13:55 
GeneralRe: PHP Pin
Jeremy Falcon6-Oct-14 13:59
professionalJeremy Falcon6-Oct-14 13:59 
GeneralRe: PHP Pin
ed welch6-Oct-14 10:45
ed welch6-Oct-14 10:45 
GeneralRe: PHP Pin
DaveX866-Oct-14 13:52
DaveX866-Oct-14 13:52 
GeneralI like the CP slot machine Pin
CDP18026-Oct-14 9:26
CDP18026-Oct-14 9:26 
JokeRe: I like the CP slot machine PinPopular
Chris Maunder6-Oct-14 9:34
cofounderChris Maunder6-Oct-14 9:34 
GeneralRe: I like the CP slot machine Pin
CDP18026-Oct-14 9:37
CDP18026-Oct-14 9:37 
GeneralRe: I like the CP slot machine Pin
Chris Maunder6-Oct-14 10:06
cofounderChris Maunder6-Oct-14 10:06 
GeneralRe: I like the CP slot machine Pin
CDP18026-Oct-14 10:14
CDP18026-Oct-14 10:14 
GeneralRe: I like the CP slot machine Pin
RTek236-Oct-14 15:24
professionalRTek236-Oct-14 15:24 
GeneralRe: I like the CP slot machine Pin
Eddy Vluggen6-Oct-14 9:47
professionalEddy Vluggen6-Oct-14 9:47 
GeneralRe: I like the CP slot machine Pin
Mark_Wallace7-Oct-14 1:11
Mark_Wallace7-Oct-14 1:11 
GeneralRe: I like the CP slot machine Pin
GenJerDan7-Oct-14 3:30
GenJerDan7-Oct-14 3:30 
GeneralRe: I like the CP slot machine Pin
Mark_Wallace7-Oct-14 8:24
Mark_Wallace7-Oct-14 8:24 
GeneralRe: I like the CP slot machine Pin
Chris Maunder7-Oct-14 14:27
cofounderChris Maunder7-Oct-14 14:27 
GeneralCountry Based Enimosity Pin
dan!sh 6-Oct-14 7:57
professional dan!sh 6-Oct-14 7:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.