xref: /plugin/statistics/vendor/mustangostang/spyc/examples/yaml-load.php (revision d5ef99ddb7dfb0cfae33e9257bd1d788f682c50f)
1*d5ef99ddSAndreas Gohr<?php
2*d5ef99ddSAndreas Gohr
3*d5ef99ddSAndreas Gohr#
4*d5ef99ddSAndreas Gohr#    S P Y C
5*d5ef99ddSAndreas Gohr#      a simple php yaml class
6*d5ef99ddSAndreas Gohr#
7*d5ef99ddSAndreas Gohr# license: [MIT License, http://www.opensource.org/licenses/mit-license.php]
8*d5ef99ddSAndreas Gohr#
9*d5ef99ddSAndreas Gohr
10*d5ef99ddSAndreas Gohrinclude('../Spyc.php');
11*d5ef99ddSAndreas Gohr
12*d5ef99ddSAndreas Gohr$array = Spyc::YAMLLoad('../spyc.yaml');
13*d5ef99ddSAndreas Gohr
14*d5ef99ddSAndreas Gohrecho '<pre><a href="spyc.yaml">spyc.yaml</a> loaded into PHP:<br/>';
15*d5ef99ddSAndreas Gohrprint_r($array);
16*d5ef99ddSAndreas Gohrecho '</pre>';
17*d5ef99ddSAndreas Gohr
18*d5ef99ddSAndreas Gohr
19*d5ef99ddSAndreas Gohrecho '<pre>YAML Data dumped back:<br/>';
20*d5ef99ddSAndreas Gohrecho Spyc::YAMLDump($array);
21*d5ef99ddSAndreas Gohrecho '</pre>';
22