2017 © Pedro Peláez
 

library php-extended-array

Extended Array for PHP

image

javaguirre/php-extended-array

Extended Array for PHP

  • Thursday, June 18, 2015
  • by javaguirre
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Extended Array for PHP

Build Status, (*1)

Just a simple extension of the PHP array using ArrayObject, (*2)

Install

Edit your composer.json file to require javaguirre/php-extended-array and run composer update, (*3)

"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, (*4)

$fruits->tropical;

// 'pineapple'

$fruits['tropical'];

// 'pineapple'

LICENSE

MIT License, (*5)

The Versions

18/06 2015

dev-master

9999999-dev https://github.com/javaguirre/php-extended-array

Extended Array for PHP

  Sources   Download

MIT

The Development Requires

array extended