News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevShed:
Handling HTML Strings and Files with the DOM XML Extension in PHP 5
March 26, 2008 @ 08:46:05

On DevShed today, they continue their series looking at working with XML in PHP with the DOM functionality with the fifth part of their series, a look at working with HTML strings and file data.

Understanding how to use the methods and properties provided by this library requires a little effort from you, despite its fairly easy learning curve. [...] The DOM XML extension has plenty of options when it comes to moving portions of an XML document (or even the entire document) from one place to another. This is certainly a process that can be performed with minor hassles by utilizing the intuitive DOM API mentioned in the beginning.

They show how to use loadHTML to pull in the text from an HTML string and use loadHTMLFile to pull it in from an external HTML file. Finally, they show how to write the data and whatever changes you might have made to it, back out to a file with saveHTMLFile.

0 comments voice your opinion now!
tutorial dom extension xml handling html savehtmlfile loadhtml loadhtmlfile


blog comments powered by Disqus

Similar Posts

Brian Moon's Blog: PHP and Memcached: The state of things

Jim Plush's Blog: Fix when compiling the Redis php extension on OSX - mach-o, but wrong architecture

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 5)

Matthew Weier O'Phinney's Blog: Pastebin app updates

Lorna Mitchell's Blog: Idiot-Proof Deployment with Phing


Community Events





Don't see your event here?
Let us know!


composer community conference security interview podcast voicesoftheelephpant series tool language release library framework laravel symfony opinion introduction version application list

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework