Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added array_undot function #4735

Closed
wants to merge 1 commit into from
Closed

Added array_undot function #4735

wants to merge 1 commit into from

Conversation

RyanNielson
Copy link
Contributor

This function converts an array with dotted keys to an associative array. Not sure if it's the best name, but hopefully some of you find the helper useful in some way.

Example:

$array = array('developer.name' => 'John Smith', 'developer.age' => 25, 'developer.address.number' => 123, 'developer.address.street' => 'Fake St');
$undottedArray = array_undot($array);
// $undottedArray is now array('developer' => array('name' => 'John Smith', 'age' => 25, 'address' => array('number' => 123, 'street' => 'Fake St')))

@Anahkiasen
Copy link
Contributor

Proposed and rejected in #4292

@GrahamCampbell
Copy link
Member

Better close this then @RyanNielson.

@RyanNielson
Copy link
Contributor Author

Thanks for the heads up guys, I'll close this. I still think it could be a useful addition, but at least it's in the repos history if we ever want to bring it back from the dead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants