2017 © Pedro Peláez
 

library map-array

This class allows you to easily map the header of array and its data to a set of names you specify.

image

frankperez87/map-array

This class allows you to easily map the header of array and its data to a set of names you specify.

  • Friday, January 2, 2015
  • by frankperez87
  • Repository
  • 1 Watchers
  • 0 Stars
  • 50 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Map Array

This class allows you to easily map the header of array and its data to a set of names you specify., (*1)

Example

<?php

require 'vendor/autoload.php';

$map = [
    'Header 1' => 'header1',
    'Header 2' => 'header2',
    'Header 3' => 'header3',
];

$data = [
    ['Header 1', 'Header 2', 'Header 3'],
    ['1:test 1', '1:test 2', '1:test 3'],
    ['2:test 1', '2:test 2', '2:test 3'],
    ['3:test 1', '3:test 2', '3:test 3'],
    ['4:test 1', '4:test 2', '4:test 3'],
];

$mapper = new MapArray\Mapper;

$mapper->addMap($map);
$mapper->addData($data);

$output = $mapper->getOrganizedData();

print '

';
print_r($output);
print '
';

Example Output

Array
(
    [0] => Array
        (
            [header1] => 1:test 1
            [header2] => 1:test 2
            [header3] => 1:test 3
        )

    [1] => Array
        (
            [header1] => 2:test 1
            [header2] => 2:test 2
            [header3] => 2:test 3
        )

    [2] => Array
        (
            [header1] => 3:test 1
            [header2] => 3:test 2
            [header3] => 3:test 3
        )

    [3] => Array
        (
            [header1] => 4:test 1
            [header2] => 4:test 2
            [header3] => 4:test 3
        )

)

The Versions

02/01 2015

dev-master

9999999-dev

This class allows you to easily map the header of array and its data to a set of names you specify.

  Sources   Download

The Development Requires

by Frank Perez

02/01 2015

v2.0.3

2.0.3.0

This class allows you to easily map the header of array and its data to a set of names you specify.

  Sources   Download

The Development Requires

by Frank Perez

31/12 2014

v2.0.2

2.0.2.0

This class allows you to easily map the header of array and its data to a set of names you specify.

  Sources   Download

The Development Requires

by Frank Perez

31/12 2014

v2.0.1

2.0.1.0

This class allows you to easily map the header of array and its data to a set of names you specify.

  Sources   Download

The Development Requires

by Frank Perez

31/12 2014

v2.0.0

2.0.0.0

This class allows you to easily map the header of array and its data to a set of names you specify.

  Sources   Download

The Development Requires

by Frank Perez

29/05 2014

v1

1.0.0.0

This class allows you to easily map the header of array and its data to a set of names you specify.

  Sources   Download

The Development Requires

by Frank Perez