Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
Need some help cleaning up my code for parsing SOAP XML response
Post Body

I wrote some code using DOM to parse a SOAP XML response. I simply want to supply the function a employee number, and it returns the userid. My code works, but I feel like it could be better. I don't like the fact that I'm going after a hard coded index childNodes[3] in case there are more or less tags. Or just curious about a better way to parse this response. Thoughts? Links below for reference.

XML: https://pastebin.com/9yDCjn7y

PHP: https://pastebin.com/0FByXB2h

Author
User Disabled
Account Strength
0%
Disabled 8 months ago
Account Age
1 year
Verified Email
Yes
Verified Flair
No
Total Karma
4,274
Link Karma
2,433
Comment Karma
1,841
Profile updated: 3 days ago
Posts updated: 9 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago