Hello and welcome to our community! Is this your first visit?
Register
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
    Posts
    446
    Thanks
    23
    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.

    BUT....

    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
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,460
    Thanks
    1
    Thanked 23 Times in 21 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, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog


  •  

    Posting Permissions

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