Skip to content

Instantly share code, notes, and snippets.

@cordoval
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cordoval/43f9344e43797ec16386 to your computer and use it in GitHub Desktop.
Save cordoval/43f9344e43797ec16386 to your computer and use it in GitHub Desktop.
Starting with components
cars:
- toyota
- nissan
{
"require": {
"symfony/yaml": "2.5"
}
}
<?php
require __DIR__.'/vendor/autoload.php';
use Symfony\Component\Yaml\Yaml;
$file = 'cars.yaml';
$array = Yaml::parse($file);
print Yaml::dump($array);
@cordoval
Copy link
Author

cordoval commented Jun 4, 2014

run with:

git clone https://gist.github.com/cordoval/43f9344e43797ec16386 .
composer install
php getcars.php

output is:

~ php getcars.php                                        luiss-mbp-3 [13:21:38]
cars:
    - toyota
    - nissan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment