parameters:
host: localhost
port: 8080
user: root
symfony/yaml library
- Add
symfony/yaml
library tocomposer.json
file:
"require": {
"symfony/yaml": "^5.0"
}
- Install library from the command line:
composer install
- Read data from YAML file:
<?php
use Symfony\Component\Yaml\Yaml;
require_once __DIR__ . '/vendor/autoload.php';
$data = Yaml::parseFile('test.yaml');
print_r($data);
Leave a Comment
Cancel reply