iMarc | Interactive Media Architects
  • Portfolio
  • Process
  • About
  • Communiqué
  • Contact
  • Support
  • Search

XML Pretty Printer in PHP5

by Will Bond - March 15, 2007 / 1:12pm

Today I was working with debugging some XML, and needed a way to make the XML more readable. The following is a little function that should do the job for some simple XML, and you can probably tweak it to your needs. It uses PHP5's SimpleXMLElement object to parse and return the XML, then indents it in a logical way.

More Articles Get the RSS Feed Post A Comment
No comments yet.

Add A Comment

Statements and opinions expressed in this blog and any comments made are the private opinions of the respective poster, and, as such, iMarc LLC is neither responsible nor liable for such content.

iMarc

iMarc is a web development company in Newburyport, MA. This is our blog.
View all blogs or learn more about iMarc.

About the Author

Will's Head Will Bond, Senior Technical Architect
I’m involved with pretty much anything computer related here at iMarc, from servers to coding and markup best practices. I’m also the unofficial resident open source advocate.

After work I spend time with my awesome wife and daughter in and around our home in beautiful Newbury, MA.
More blogs by Will

Search Our Blog

Recent Communiqués

  • for lack of nail
  • You're Not Crazy for Smiling at your Plant
  • Book Recommendation: Writing Tools
  • Redundancy: Good or Bad?
  • Making the Switch to Gmail
  • Character Removal
  • Subway Art
  • Using rsync to synchronize iTunes libraries
  • Enough is Enough.
  • Targeted Inspiration
  • Green Benefit, Good Cause
  • Dashes, Underscores, URLs, SEO and Humans
  • Newburyport Web Geek Meetup, Thursday March 20th
  • 01001110 01001001 01001110: The Revolution Continues
  • iMarc's Newest Member

Popular Communiqués

  • You're Not Crazy for Smiling at your Plant
  • for lack of nail
  • How to Make Links
  • Book Recommendation: Writing Tools
  • Using rsync to synchronize iTunes libraries
  • Patrick, From My Perspective
  • Subway Art
  • Character Removal
  • Green Benefit, Good Cause
  • Dashes, Underscores, URLs, SEO and Humans

Recent Comments

  • You're Not Crazy for Smiling at your Plant

    By Elyse Holladay: Watch out - that notebook looks like it'd bite your hand off!

  • for lack of nail

    By Patrick McPhail: Fixed: http://$controller->url.nin

  • for lack of nail

    By Peter R. Wood: Nice to see they're using an MVC paradigm. Too bad they didn't test their email first.

  • You're Not Crazy for Smiling at your Plant

    By Robert Mohns: "You'll note that there is an odd number so that votes can't end up in a tie." Now we…

  • You're Not Crazy for Smiling at your Plant

    By Fred LeBlanc: You'll note that there is an odd number so that votes can't end up in a tie.

RSS

RSS Icon Learn about RSS and get the feed for our blog.

About iMarc

  • We build custom web sites
  • In-house strategy, design, programming, hosting
  • In business since 1997
  • We’re located in Newburyport, MA
  • Call us at (978) 462-8848

© 2008 iMarc LLC, Contact Us

Links

  • Home
  • Portfolio
  • Client Support
  • Log In
  • (icon)RSS

Meet the Team

Karin's Head Karin Klapak, Director of Sales and Marketing

I focus on collaborating with new clients to refine strategy and define projects. Then I help tell the story of all the great work and creativity.

Learn More | Meet the Others