phacman/php-yaml

Compact version: Loads and dumps YAML files

v1.0.0 2023-10-29 05:50 UTC

This package is auto-updated.

Last update: 2024-05-29 07:13:13 UTC


README

The Yaml loads and dumps YAML files.

History with a list of original committers/commits: shortlog.txt

Getting Started

Read file

use PhacMan\Yaml\Yaml;
$yaml = Yaml::parseFile('some.yaml');
print_r($yaml);

Write file

use PhacMan\Yaml\Yaml;
$array = [
    'foo' => 'bar',
    'bar' => ['foo' => 'bar', 'bar' => 'baz'],
];
$yaml = Yaml::dump($array);
file_put_contents('written.yaml', $yaml);

Usage details: here

Resources