PHP code example of husam-awadhi / power-parser

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

    

husam-awadhi / power-parser example snippets


try {
    $pp = new PowerParser();
    $parser = $pp->getParserBuilder(
                stream: 'path-to-blueprint.yml',
                file: 'path-to-file.ext'
        )->build();
    $parsedData = $parser->parse()->getAsArray();
} catch (Exception $e) {
    // hmm
}