1. Go to this page and download the library: Download cocur/vale library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
cocur / vale example snippets
$name = Vale::get($families, ['lannister', 'leader', 'children', 2, 'name']);
// This would be equal to the following
$name = null;
if (isset($families['lannister']) && $families['lannister']) {
if ($families['lannister']->getLeader()) {
if (isset($families['lannister']->getLeader()->children[2]) && $families['lannister']->getLeader()->children[2]) {
$name = $families['lannister']->getLeader()->children[2]->name();
}
}
}