Yaml offers convenience methods to load and dump YAML.
author |
Fabien Potencier |
---|---|
api |
enablePhpParsing()
parse(string $input) : array
The parse method, when supplied with a YAML stream (string or file), will do its best to convert YAML in a file into a PHP array.
Usage:
$array = Yaml::parse('config.yml');
print_r($array);
throws |
If the YAML is not valid |
---|---|
string
Path to a YAML file or a string containing YAML
array
The YAML converted to a PHP array
dump(array $array, integer $inline = 2) : string
The dump method, when supplied with an array, will do its best to convert the array into friendly YAML.
array
PHP array
integer
The level where you switch to inline YAML
string
A YAML string representing the original PHP array
enablePhpParsing :