PHP code example of mindplay / easyxml

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

    

mindplay / easyxml example snippets


$doc = new Parser();

$doc['cats/cat'] = function (Visitor $cat, $name) {
    echo "a cat named: {$name}\n";

    $cat['kitten'] = function ($name) {
        echo "a kitten named: {$name}\n";
    };
};

$doc->parseFile('my_cats.xml');