PHP code example of laravie / parser
1. Go to this page and download the library: Download laravie/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/ */
laravie / parser example snippets
$user = [
'id' => '1',
'email' => '[email protected]',
'followers' => '5'
];
use Laravie\Parser\Xml\Reader;
use Laravie\Parser\Xml\Document;
$xml = (new Reader(new Document()))->load('path/to/above.xml');
$user = $xml->parse([
'id' => ['uses' => 'user.id'],
'email' => ['uses' => 'user.email'],
'followers' => ['uses' => 'user::followers'],
]);