PHP code example of ustream / arr

1. Go to this page and download the library: Download ustream/arr 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/ */

    

ustream / arr example snippets


$sample = array(
  "foo" => array(
    "bar" => array(
      "baz" => "something"
    )
  )
);

$extractor = new PathExtractor(array("foo", "bar", "baz"));
$result = $extractor->extract($sample);
//        "something" # inside an Option instance

$extractor = new PathExtractor(array("foo", "bar"));
$result = $extractor->extract($sample);
//        array("baz" => "something") # inside an Option instance

$extractor = new PathExtractor(array("foo"));
$result = $extractor->extract($sample);
//        array("bar" => array("baz" => "something")) # inside an Option instance