PHP code example of znframework / package-xml

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

    

znframework / package-xml example snippets


 N::run();

$data = XML::build
([  
    'name'  => 'media', 
    'attr'  => ['id' => 1], 
    'child' => 
    [ 
        ['name' => 'video', 'attr' => ['id' => 2], 'content' => 'Vidyo'], 
        [
            'name'  => 'music', 
            'attr'  => ['id' => 3], 
            'child' => 
            [ 
                ['name' => 'video', 'attr' => ['id' => 2], 'content' => 'Vidyo'], 
                ['name' => 'video', 'attr' => ['id' => 2], 'content' => 'Vidyo'], 
                ['name' => 'video', 'attr' => ['id' => 2], 'content' => 'Vidyo'] 
            ]
        ]
    ]
]);

Output::display($data);