javaguirre / php-extended-array
Extended Array for PHP
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/javaguirre/php-extended-array
Requires (Dev)
- phpunit/phpunit: >=4.0.0
This package is not auto-updated.
Last update: 2025-10-25 23:27:03 UTC
README
Just a simple extension of the PHP array using ArrayObject
Install
Edit your composer.json file to require javaguirre/php-extended-array and run composer update
"require": { "javaguirre/php-extended-array": "dev-master" }
Usage
<?php use TA\ExtendedArray\Type\ExtendedArray; $fruits = new ExtendedArray( array( 'tropical' => 'pineapple', 'farm' => 'strawberry' ) ); $fruits->has('tropical'); // true $fruits->hasOne(array('tropical', 'asian')); // true $fruits->hasAll(array('tropical', 'asian')); // false $fruits->get('canary', 'banana'); // 'banana' $fruits->get('tropical', 'banana'); // 'pineapple' $fruits->getSubArray(array('tropical')); // array('tropical' => 'pineapple'); $fruits->toArray(); // array('tropical' => 'pineapple', 'farm' => 'strawberry');
Key access
You can access properties as If it was an object or an array
$fruits->tropical; // 'pineapple' $fruits['tropical']; // 'pineapple'