PHP code example of orchestra / parser

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

    

orchestra / parser example snippets


$user = [
    'id' => '1',
    'email' => '[email protected]',
    'followers' => '5'
];

use Orchestra\Parser\Xml\Facade as XmlParser;

$xml = XmlParser::load('path/to/above.xml');
$user = $xml->parse([
    'id' => ['uses' => 'user.id'],
    'email' => ['uses' => 'user.email'],
    'followers' => ['uses' => 'user::followers'],
]);

'providers' => [

    // ...

    Orchestra\Parser\XmlServiceProvider::class,
],

'aliases' => [

    // ...

    'XmlParser' => Orchestra\Parser\Xml\Facade::class,
],