class Yaml
Yaml offers convenience methods to load and dump YAML.
Constants
DUMP_OBJECT | |
PARSE_EXCEPTION_ON_INVALID_TYPE | |
PARSE_OBJECT | |
PARSE_OBJECT_FOR_MAP | |
DUMP_EXCEPTION_ON_INVALID_TYPE | |
PARSE_DATETIME | |
DUMP_OBJECT_AS_MAP | |
DUMP_MULTI_LINE_LITERAL_BLOCK |
Methods
static mixed | parse(string $input, int $flags) Parses YAML into a PHP value. | |
static string | dump(mixed $input, int $inline = 2, int $indent = 4, int $flags) Dumps a PHP value to a YAML string. |
Details
static mixed parse(string $input, int $flags)
Parses YAML into a PHP value.
Usage:
$array = Yaml::parse(filegetcontents('config.yml'));
print_r($array);
static string dump(mixed $input, int $inline = 2, int $indent = 4, int $flags)
Dumps a PHP value to a YAML string.
The dump method, when supplied with an array, will do its best to convert the array into friendly YAML.
Please login to continue.