PHP code example of amund / html

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

    

amund / html example snippets


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

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

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

echo html::render($data);

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