Feature highlights
-
Zero-dependency PHP library
Simdom is designed to be a replacement of the native PHP extension dom. You do not have to worry if your web server has the extension installed. Being a zero-dependency library, you know exactly what you have installed in your project.
-
HTML5 as first-class citizen
Simdom embraces the modern HTML5 standard. Unlink the native PHP extension dom, Simdom does not require any configuration or warning suppression to start working with HTML5. HTML5 doctype and new elements, e.g.
<main>
, are supported out of the box. -
Customised pretty HTML output
When it comes to pretty HTML output, Simdom gives you the flexibility to customise the indentation, void element style (
<br>
vs<br />
), and attribute escaping style. -
Better code completion support
All public methods and properties in Simdom are well documented with PHPDoc. Leverage this in your source-code editor to boost productivity.
-
Go beyond the HTML5 specification
Simdom has its personal touch in implementing HTML5 specification. For example:
-
Attr
interface does not inherit fromNode
, so with type checking you will never insert an attribute into document node. -
HTMLCollection.item()
by specification returnsNode
interface, but Simdom gives youElement
instead. -
Element
interface has a new methoddfs()
for easier descendant traversal.
There are many more coding-friendly improvements awaiting you to discover.
-
Demo
Paste your HTML snippet or a website URL and press the "Parse" button to see the result.
Parse Result
Result as JSON
{{ jsonText }}