PHP code example of greencape / xml-converter

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

    

greencape / xml-converter example snippets




$xml = new \GreenCape\Xml\Converter('<?xml version="1.0" encoding="ISO-8859-1"


$xml = new \GreenCape\Xml\Converter('some_xml_file.xml');
var_dump($xml->data);


$xml = new \GreenCape\Xml\Converter(array(
    'breakfast_menu' => array(
        array(
            'food' => array(
                'name' => 'Waffles'
            )
        )
    )
));
echo $xml;
bash
$ composer global