PHP code example of frankperez87 / map-array

1. Go to this page and download the library: Download frankperez87/map-array library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

frankperez87 / map-array example snippets




= [
    '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 '<pre>';
print_r($output);
print '</pre>';