PHP code example of arhframe / yamlarh

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

    

arhframe / yamlarh example snippets


use Arhframe\Yamlarh\Yamlarh;

$yamlarh = new Yamlarh(__DIR__.'/path/to/formatted/file');
$array = $yamlarh->parse();

use Arhframe\Yamlarh\Yamlarh;
$var3 = 'testvar';
define('VARCONSTANT', 'testconstant');
$yamlarh = new Yamlarh(__DIR__.'/test.yml');
$yamlarh->addAccessibleVariable("addedInYamlarh", "var added");
$array = $yamlarh->parse();
echo print_r($array);

//create your yamalarh instance before
$yamlarh->addNode("myNodeName", new MyYamlarhNode());
yml
arhframe:
  file: !! Arhframe.Util.File(test.php) #will instanciate this: Arhframe\Util\File('test.php') in file var after parsing