A small library to help you parse and generate indented strings.
YAML is a full-featured markup language, while indented strings have only two base datatypes: Object node and string/int/float.
Indented strings are great for:
- Taxonomic data
- Directory structure
- Lists
But YAML would be a better choice, if you need to store:
- Configuration file
- Complicated data
composer require maximizer/indents
<?php
use Maximizer\Indentations\Indents;
$parser = new Indents;
$parser->parseFromFile("myFile.xis", Indents::TO_ASSOC);
$parser->parseFromString("", Indents::TO_ASSOC);
<?php
use Maximizer\Indentations\IndentGenerator;
$array = [
"root" => [
"a",
"b",
"c" => ["d", "e"],
],
];
$gen = new IndentGenerator;
$gen->generate($array);
ISC License