Last active
August 29, 2015 14:02
-
-
Save cordoval/43f9344e43797ec16386 to your computer and use it in GitHub Desktop.
Starting with components
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/vendor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cars: | |
- toyota | |
- nissan | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require": { | |
"symfony/yaml": "2.5" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require __DIR__.'/vendor/autoload.php'; | |
use Symfony\Component\Yaml\Yaml; | |
$file = 'cars.yaml'; | |
$array = Yaml::parse($file); | |
print Yaml::dump($array); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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