PHP code example of hiraku / xml_builder

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

    

hiraku / xml_builder example snippets



builder(array('doctype'=>XML_Builder::$XHTML11))
->html(array('xmlns'=>XML_Builder::NS_XHTML))
    ->head
        ->meta_(array('http-equiv'=>'Content-Type','content'=>'text/html; charset=UTF-8'))
        ->title_('サンプルHTML')
    ->_
    ->body
        ->div(array('id'=>'wrapper'))
            ->h1_('サンプルHTML')
            ->p_('サンプル')
        ->_
    ->_
->_

->_echo();