Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    May 2008
    Thanked 5 Times in 5 Posts

    echoing simplexml problems

    I have a simpleXML object that I use addChild on then use a foreach loop to echo out specific node values.

    Before the addChild is performed the simpleXml gets the data just fine. Afterwards The data from the foreach will echo nothing and it will iterate through 3 times when there is only 2 nodes to loop through.


    if I run a print_r() on my simpleXml object before I run my foreach, bam problem solved. turn off the print_r() and the problem returns.

    do I need to parse my data as a string for the echo? It works fine until the addChild method is run.

    I have checked my xml with nodes and all to make sure that all the nodes were there as they should be, so this is not the problem.

    Any thoughts?

  2. #2
    Join Date
    May 2002
    Hayward, CA
    Thanked 24 Times in 22 Posts
    Post the code?
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, ES7-Membrane project (Github Pages site)
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts