mirror of
https://gh.wpcy.net/https://github.com/LJPc-solutions/freescout-calendar-module.git
synced 2026-07-16 01:50:21 +08:00
26 lines
No EOL
510 B
PHP
26 lines
No EOL
510 B
PHP
<?php
|
|
require_once __DIR__.'/../vendor/autoload.php';
|
|
|
|
use Dallgoot\Yaml\Yaml;
|
|
|
|
$debug = 0;
|
|
|
|
/* USE CASE 1
|
|
* load and parse if file exists
|
|
*/
|
|
$yaml = Yaml::parseFile('./examples/dummy.yml', 0, $debug);
|
|
|
|
print_r($yaml->object->array[0]);
|
|
|
|
$yamlContent = <<<EOF
|
|
--- some document we don't care about
|
|
# below the document we want
|
|
---
|
|
- ignore_me
|
|
- mapping:
|
|
somekey:
|
|
array:
|
|
- OK
|
|
EOF;
|
|
$second_document = Yaml::parse($yamlContent)[1];
|
|
print_r($second_document[1]->mapping->somekey->array[0]); |