PHPackages                             progphil1337/php-html - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. progphil1337/php-html

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

progphil1337/php-html
=====================

Create HTML code using PHP

v1.0.2(3y ago)0101MITPHPPHP ^8.1

Since Sep 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/progphil1337/php-html)[ Packagist](https://packagist.org/packages/progphil1337/php-html)[ RSS](/packages/progphil1337-php-html/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (1)

PHP-HTML
========

[](#php-html)

Create valid HTML code with PHP

Installation
------------

[](#installation)

Install with composer:

```
$ composer require progphil1337/php-html
```

Compatibility
-------------

[](#compatibility)

`ProgPhil1337\HTML` requires PHP 8.1 (or better).

Usage
-----

[](#usage)

### Basic example

[](#basic-example)

```
use ProgPhil1337\HTML\Attribute\Style;
use ProgPhil1337\HTML\Element;

$html = new Element('html');

// Create  with
$head = new Element('head');
$title = new Element('title');
$title->innerText('Website Title');

$head->add($title);

$html->add($head);

// Create  with styled box
$body = new Element('body');
$body->add(new Style([
    'background-color' => '#ecf0f1',
    'width' => '600px',
    'margin' => '0 auto'
]));

$div = new Element('div');
$div->add(new Style([
    'background-color' => 'white',
    'margin-top' => '50px',
    'border-radius' => '3px',
    'padding' => '13px'
]));

$div->appendHTML('PHP-HTML');
$div->appendText('Create valid HTML code with PHP.');

$body->add($div);
$html->add($body);

echo $html;
```

Outputs the following HTML code:

```

Website Title

PHP-HTML
Create valid HTML code with PHP.

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

3

Last Release

1341d ago

### Community

Maintainers

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

---

Top Contributors

[![progphil1337](https://avatars.githubusercontent.com/u/8302313?v=4)](https://github.com/progphil1337 "progphil1337 (1 commits)")

### Embed Badge

![Health badge](/badges/progphil1337-php-html/health.svg)

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

PHPackages © 2026

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