PHPackages                             evilfreelancer/yaml-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. evilfreelancer/yaml-php

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

evilfreelancer/yaml-php
=======================

Small PHP library for importing and exporting with validation of YAML configuration files.

0.4.1(8y ago)2141MITPHPPHP &gt;=7.0

Since Mar 1Pushed 8y ago3 watchersCompare

[ Source](https://github.com/EvilFreelancer/yaml-php)[ Packagist](https://packagist.org/packages/evilfreelancer/yaml-php)[ RSS](/packages/evilfreelancer-yaml-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (8)Used By (1)

YAML PHP Import/Export with validation
======================================

[](#yaml-php-importexport-with-validation)

Small PHP library for importing and exporting with validation of YAML configuration files.

```
composer require evilfreelancer/yaml-php

```

For correct work you need install YAML extension of PHP interpreter.

Available methods
-----------------

[](#available-methods)

- `read` - Read YAML from file or URL (autodetect)
- `add` - Add without replace array of parameters
- `set` - Add with replace array of parameters
- `validate` - Check array of parameters in memory by validation template
- `get` - Return array of prepared parameters
- `save` - Export parameters in YAML format to file on filesystem
- `show` - Return YAML in plain text format

How to use
----------

[](#how-to-use)

More examples [here](extra).

### Basic example of usage

[](#basic-example-of-usage)

```
