定制 javaguirre/php-extended-array 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

javaguirre/php-extended-array

Composer 安装命令:

composer require javaguirre/php-extended-array

包简介

Extended Array for PHP

README 文档

README

Build Status

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'

LICENSE

MIT License

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-18