rwillians / stingray
This package is abandoned and no longer maintained.
No replacement package was suggested.
Dot notation reader/writer for multidimensional arrays in PHP.
2.1.0
2016-04-11 13:35 UTC
Requires
- php: >=5.3.3
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- phpunit/phpunit: ^4.0
README
Dot notation reader/writer for multidimensional arrays in PHP.
Installing via Composer
Add Stingray to your project:
$> composer.phar require rwillians/stingray ^2.0
or directly to composer.json:
{ "require": { "rwillians/stingray": "^2.0" } }
Then update your dependencies:
$> composer.phar update
Example Usage
To get any node from an array:
use Rwillians\Stingray\Stingray; $someArray = array( 'client' => array( 'name' = 'John Doe' ) ); // Getting a value using dot notation: echo Stingray::get($someArray, 'client.name'); // Outputs: 'John Doe' // Changing a value using dot notation: Stingray::set($someArray, 'client.name', 'Jane Doe'); // Create a new key-value to an existent array using dot notation: Stingray::set($someArray, 'client.address', 'Some Street, 123');