Skip to content

colindev/php-object-chain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

colin/object-chain

php 物件/陣列 索引鍊


install

設定依賴套件,並更新

    composer require colin/object-chain
    composer update

test

執行單元測試

    
    phpunit

sample

use Colin\ObjectChain;

$data = new ObjectChain(json_decode('{"key":"hello","vary":{"depth":{"key":"found"}}}'));

$data->{'key'}->value();// return 'hello'
$data['key']->value();// return 'hello'

$data['vary']['depth']['key']->value();// return 'found'
$data['vary']['depth']['depth']['key']->value();// return null

About

php 物件索引鍊

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages