amund/html

A PHP library for generating HTML content from PHP arrays.

Maintainers

Package info

github.com/Amund/html

pkg:composer/amund/html

Statistics

Installs: 112

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.5 2026-01-24 23:43 UTC

This package is auto-updated.

Last update: 2026-03-25 00:11:46 UTC


README

GitHub Tag Packagist Version

PHP HTML Library

A PHP library for generating HTML content from PHP arrays.

Installation

composer require amund/html

Usage

Generating single tags

Use the tag method to generate single HTML tags.

echo html::tag('div', ['class'=>'test'], 'Hello World');

// Output: <div class="test">Hello World</div>

Rendering HTML content

Use the render method to render HTML content from an array.

$data = [
    'tag' => 'div',
    'class' => 'test',
    'content' => [
        'Hello ',
        [
            'tag'=>'b',
            'content'=>'World'
        ],
        ' !',
    ],
];

echo html::render($data);

// Output: <div class="test">Hello <b>World</b> !</div>