News Feed
Sections




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

PHPBuilder.com:
PHP Simple HTML DOM Parser Editing HTML Elements in PHP
September 08, 2011 @ 10:06:07

On PHPBuilder.com today there's a new tutorial from Vojislav Janjic about using a simple DOM parser in PHP to edit the markup even if it's not correctly W3C-formatted - the Simple HTML DOM Parser

Simple HTML DOM parser is a PHP 5+ class which helps you manipulate HTML elements. The class is not limited to valid HTML; it can also work with HTML code that did not pass W3C validation. Document objects can be found using selectors, similar to those in jQuery. You can find elements by ids, classes, tags, and much more. DOM elements can also be added, deleted or altered.

They help you get started using the parser, passing in the HTML content to be handled (either directly via a string or loading a file) and locating elements in the document either by ID, class or tag. Selectors similar to those in CSS are available. Finally, they show how to find an object and update its contents, either by adding more HTML inside or by appending a new object after it.

0 comments voice your opinion now!
simple html dom parse tutorial selector find replace edit


blog comments powered by Disqus

Similar Posts

DevShed: Searching and Replacing Nodes with SimpleXML in PHP 5 (Part 3)

Zend Developer Zone: SQLite: Lean, Mean DB Machine

PHPRiot.com: Zend Framework 101: Zend_Loader

PHP-Coding-Practices.com: How I Turned A Slow Array Sort Into A Quick One Using Quicksort Algorithm

NetTuts.com: 30+ Awesome CodeIgniter Tutorials for all Skill Levels


Community Events





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


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

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