PHP code example of ucscode / dom-element

1. Go to this page and download the library: Download ucscode/dom-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/ */

    

ucscode / dom-element example snippets


interface DOMElementNameInterface
{
    public const NODE_A = 'A';
    public const NODE_BLOCKQUOTE = 'BLOCKQUOTE';
    public const NODE_BODY = 'BODY';
    public const NODE_BR = 'BR';
    public const NODE_BUTTON = 'BUTTON';
    public const NODE_FIELDSET = 'FIELDSET';
    public const NODE_H1 = 'H1';
    public const NODE_H2 = 'H2';
    // and so on...
}



use Ucscode\DOMElement\DOMElementNameInterface;

$document = new DOMDocument();

$divElement = $document->createElement(DOMElementNameInterface::NODE_DIV);

$spanElement = new DOMElement(DOMElementNameInterface::NODE_SPAN);

// ...