承接 mdantas/csv-map 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

mdantas/csv-map

Composer 安装命令:

composer require mdantas/csv-map

包简介

This goal of lib, is a implementation methods top of spout, to group, filter, extract some informations from csv files.

README 文档

README

CSV-Map

This lib have goal to manage some csv files with a filter methods, it is built top of box/soap, for more detailed examples, see: Tests Examples.

Requirements
-   >= PHP7.2
-   box/spout 3.1.0
Install
composer require mdantas/csv-map
Methods

All methods can be found at CsvMap\Interfaces\CsvCollectionInterface

getHeaders - Get array of headers from csv file.

hasHeader - Check if header exists on csv file.

groupBy - group arrays of values, the index of array is based on $row[headerName].

combine - mount array by value of index by row and intersect values from some headers.

extract - extract only columns of values, with or without duplicated values.

isEmpty - check if collection is empty.

each - shortcut for simple callable function on each item.

toArray - produces array indexed by header name with row values, like: [$headername => $rowValue]

Examples
use CsvMap\Collection;

$fileCsvPath = './filecsv';

$csvCollection = Collection::factory($fileCsvPath);

$csvCollection->getHeaders(): array;

$csvCollection->hasHeader('headerName'): bool;
 
$csvCollection->combine('id', 'name', 'id', ...): array;
    
$csvCollection->groupBy('id'): array;

$csvCollection->extract('id', true): array // Last param remove duplicated registers

$csvCollection->isEmpty(): bool;

$csvCollection->each(function($item) => {
    print_r($item);
});

$csvCollection->toArray();
Tests
composer run tests

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固