array-access PHP multi array access

  1. Installation
  2. Usage examples

PHP multi array access

https://github.com/petrgrishin/array-access/

Installation

Add a dependency to your project's composer.json file if you use Composer to manage the dependencies of your project:

{
    "require": {
        "petrgrishin/array-access": "~1.0"
    }
}

Usage examples

Basic usage array-access objects
use \PetrGrishin\ArrayAccess\ArrayAccess;

$arrayParams = array(
    'a' => array(
        'b' => 10,
    )
);
$params = ArrayAccess::create($arrayParams);
$value = $params->getValue('a.b');
$params
    ->setValue('a.b', 20)
    ->setValue('a.c', 30);
$params->remove('a.b');
$resultArrayParams = $params->getArray();
1 0
1 follower
158 downloads
Yii Version: all
License: MIT
Category: Console
Developed by: Petr.Grishin
Created on: Jun 2, 2014
Last updated: 8 years ago

Downloads

show all

Related Extensions