PHP code example of buymeua / parser

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

    

buymeua / parser example snippets


return [
    /*
    |------------------------------------------------------------------------------------------------------------
    | The package will use this mapping_parser for detect what adapter need connect to parse file by extension.
    |------------------------------------------------------------------------------------------------------------
    */
    "adapters" => [
        'xml' => \Buyme\Parser\Adapter\SimpleXML::class,
        'yml' => \Buyme\Parser\Adapter\XMLReader::class,
    ],
];

use Buyme\Parser\Facades\BuymeParser;

use Buyme\Parser\BuymeParser;

$byml = app(BuymeParser::class);

public function __construct(private BuymeParser $buymeParser)
{
}

$this->buymeParser->open('https://example.com/file.yml');

$this->buymeParser->open('storage/xml/file.yml');

$categories = $this->buymeParser->getCategories();
$currencies = $this->buymeParser->getCurrencies();
$products = $this->buymeParser->getProducts();
bash
sudo apt-get install php-xmlrpc php-mbstring