2017 © Pedro Peláez
 

library array_keys_recursive

Library to get array keys of a multidimensional array, retaining the original array structure.

image

lucasantarella/array_keys_recursive

Library to get array keys of a multidimensional array, retaining the original array structure.

  • Saturday, November 25, 2017
  • by lucasantarella
  • Repository
  • 1 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 117 % Grown

The README.md

Recursive PHP array_keys()!

Build Status License Issues, (*1)

Description

A simple library for getting the array_keys() of a multidimensional array., (*2)

Installation

Composer

$ composer require lucasantarella/php-array-keys-recursive

Usage

<?php

require_once __DIR__ . '/vendor/autoload.php';

$input = [
    'person' => [
        'name' => [
            'first' => 'Luca',
            'middle' => 'Michele',
            'last' => 'Santarella'
        ],
        'dob' => '11/11/1999',
        'knowledge' => [
            'programming' => [
                'languages' => [
                    'PHP',
                    'JS',
                    'HTML',
                    'SQL',
                    'JAVA'
                ]
            ]
        ]
    ]
];

$output = \LucaSantarella\ArrayKeysRecursive::getKeys($input);

Result

array (
  'person' => 
  array (
    'name' => 
    array (
      0 => 'first',
      1 => 'middle',
      2 => 'last',
    ),
    0 => 'dob',
    'knowledge' => 
    array (
      'programming' => 
      array (
        'languages' => 
        array (
          0 => 0,
          1 => 1,
          2 => 2,
          3 => 3,
          4 => 4,
        ),
      ),
    ),
  ),
)

The Versions

25/11 2017

dev-master

9999999-dev https://github.com/lucasantarella/php-array-keys-recursive

Library to get array keys of a multidimensional array, retaining the original array structure.

  Sources   Download

AGPL-3.0+

The Requires

  • php >=5.4.0

 

The Development Requires

php array recursive multidimensional array_keys array_keys_recursive

22/11 2017

1.0.0

1.0.0.0

Library to get array keys of a multidimensional array, retaining the original array structure.

  Sources   Download

AGPL-3.0+

The Development Requires

php array recursive multidimensional array_keys