PHPackages                             oscarotero/html-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. oscarotero/html-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

oscarotero/html-parser
======================

Parse html strings to DOMDocument

v0.1.8(2y ago)165.0M—9.2%11MITHTMLPHP ^7.2 || ^8

Since Apr 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/oscarotero/html-parser)[ Packagist](https://packagist.org/packages/oscarotero/html-parser)[ Docs](https://github.com/oscarotero/html-parser)[ RSS](/packages/oscarotero-html-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (10)Used By (1)

HTML parser
===========

[](#html-parser)

Simple utility to parse html strings to DOMDocument.

```
composer require oscarotero/html-parser
```

Usage
-----

[](#usage)

```
use HtmlParser\Parser;

$html = 'Hello world';

//Convert a string to a DOMDocument
$document = Parser::parse($html);

//Convert a string to a DOMDocumentFragment
$fragment = Parser::parseFragment('Hello world');

//Convert a DOMDocument or DOMDocumentFragment to a string
echo Parser::stringify($document);
echo Parser::stringify($fragment);
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~210 days

Recently: every ~361 days

Total

9

Last Release

901d ago

PHP version history (2 changes)v0.1.0PHP &gt;=7.2

v0.1.5PHP ^7.2 || ^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/e99df56b617f4af8cf0556a51a0ca20c7420104920c57d7e9eab093f92bb744f?d=identicon)[oscarotero](/maintainers/oscarotero)

---

Top Contributors

[![oscarotero](https://avatars.githubusercontent.com/u/377873?v=4)](https://github.com/oscarotero "oscarotero (28 commits)")[![emteknetnz](https://avatars.githubusercontent.com/u/4809037?v=4)](https://github.com/emteknetnz "emteknetnz (2 commits)")[![kzgzhn](https://avatars.githubusercontent.com/u/25562540?v=4)](https://github.com/kzgzhn "kzgzhn (1 commits)")[![nerg4l](https://avatars.githubusercontent.com/u/4079392?v=4)](https://github.com/nerg4l "nerg4l (1 commits)")

---

Tags

htmlparserparserhtmldom

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/oscarotero-html-parser/health.svg)

```
[![Health](https://phpackages.com/badges/oscarotero-html-parser/health.svg)](https://phpackages.com/packages/oscarotero-html-parser)
```

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[paquettg/php-html-parser

An HTML DOM parser. It allows you to manipulate HTML. Find tags on an HTML page with selectors just like jQuery.

2.4k7.9M123](/packages/paquettg-php-html-parser)[sunra/php-simple-html-dom-parser

Composer adaptation of: A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way! Require PHP 5+. Supports invalid HTML. Find tags on an HTML page with selectors just like jQuery. Extract contents from HTML in a single line.

1.3k9.4M61](/packages/sunra-php-simple-html-dom-parser)[simplehtmldom/simplehtmldom

A fast, simple and reliable HTML document parser for PHP.

1921.3M14](/packages/simplehtmldom-simplehtmldom)[scotteh/php-dom-wrapper

Simple DOM wrapper to select nodes using either CSS or XPath expressions and manipulate results quickly and easily.

1471.9M10](/packages/scotteh-php-dom-wrapper)[ressio/pharse

Fastest PHP HTML Parser

8478.4k](/packages/ressio-pharse)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
