I have one YAML file like this
category: 'test'
available: true
class: true
name: 'john'
children:
-
id: fdfd5
f2: 30
Now before that name field i want to add one more file like
displayname = This is your $name where $name is name from same category.
This is what i am thinkling of
//read
$yaml = Yaml::parse(file_get_contents('/path/to/file.yml'));
//code here
//write
$dumper = new Dumper();
$yaml = $dumper->dump($array);
file_put_contents('/path/to/file.yml', $yaml);
How can i get $array to what i want