1. Go to this page and download the library: Download vdhicts/html-element library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
vdhicts / html-element example snippets
use Vdhicts\HtmlElement\HtmlElement;
// Create new html element with attribute name
$selectElement = new HtmlElement('select');
$selectElement->setAttribute('name', 'something');
$selectElement->generate();
// Create new html element with text and attribute
$paragraphElement = new HtmlElement('p', 'text', ['class' => 'center']);
use Vdhicts\HtmlElement\HtmlElement;
$containerElement = new HtmlElement('div');
$containerElement->setAttribute('class', 'container');