1. Go to this page and download the library: Download xchert/property-access 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/ */
xchert / property-access example snippets
use Xchert\PropertyAccess\PropertyAccessor;
use Xchert\PropertyAccess\ArrayAccessor;
use Xchert\PropertyAccess\ObjectAccessor;
$propertyAccessor = new PropertyAccessor();
// Register ArrayAccessor for array support
$propertyAccessor->registerAccessor(new ArrayAccessor(), ArrayAccessor::ID, 0);
// Register ObjectAccessor for object support
$propertyAccessor->registerAccessor(new ObjectAccessor(), ObjectAccessor::ID, 0);
use Xchert\PropertyAccess\Path;
// Using constructor
$path = new Path(['user', 'profile', 'name']);
// Parsing from JSON string
$path = Path::parse('["user", "profile", "name"]');