znframework/package-xml

ZN Framework XML Package

7.0.3 2022-06-23 12:13 UTC

This package is auto-updated.

Last update: 2024-10-23 17:09:00 UTC


README

ZN Framework XML Package

Follow the steps below for installation and use.

Installation

You only need to run the following code for the installation.

composer require znframework/package-xml

Documentation

Click for documentation of your library.

Example Usage

Basic level usage is shown below.

<?php require 'vendor/autoload.php';

ZN\ZN::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);
<?xml version="1.0" encoding="UTF-8"?>
<media id="1">
	<video id="2">Vidyo</video>
	<music id="3">
		<video id="2">Vidyo</video>
		<video id="2">Vidyo</video>
		<video id="2">Vidyo</video>
	</music>
</media>