thanhtaivtt/collection 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

thanhtaivtt/collection

Composer 安装命令:

composer require thanhtaivtt/collection

包简介

Array collection for PHP

README 文档

README

Install

composer require thanhtaivtt/collection

Usage

use thanhtaivtt\Collection\Collection;

//init
$collection = new Collection([1,2,3,4,5,6]);

//or
Collection::init([1,2,3,6,4]);

Suport Methods

sum

  • The sum method returns the sum of all items in the collection:
    Collection::init([1, 2, 3])->sum();
    // 6

sum

  • The avg method returns the average of all items in the collection:
    Collection::init([1, 2, 3])->avg();
    // 2

min

  • The min method returns the min of all items in the collection:
    Collection::init([1, 2, 3])->min();
    // 1

max

  • The max method returns the max of all items in the collection:
    Collection::init([1, 2, 3])->max();
    // 1

all

  • The all method returns the all items in the collection:
    Collection::init([1, 2, 3])->all();
    // [1,2,3]

chunk

  • The chunk method breaks the collection into multiple, smaller collections of a given length:
    $chunk = Collection::init([1, 2, 3])->chunk(2);
    $chunk->toArray();
    // [[1, 2], [3]]

toArray

  • The toArray method converts all items in Object to Array:
    $chunk = Collection::init([1, 2, 3])->toArray();
    // [1, 2, 3]

....

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固