PHP code example of arturu / xml-tag

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

    

arturu / xml-tag example snippets



use Arturu\XMLTag\Element;

$tag = array(
    'type'=> 'div', // optional
    'attributes'=> array("id"=>"testId","class"=>"a b c",foo"=>"bar"), // optional
    'injectTag' => false // optional, inject raw text in to tag
    'implicit'=> false, // optional, closure implicit set text ' />'
    'content' => "Test content", // optional
);
echo Element::render($tag);