nathggns / key_implode
Implode PHP array by both key and value
Installs: 1 088
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/nathggns/key_implode
This package is not auto-updated.
Last update: 2020-01-20 03:23:50 UTC
README
Implode PHP array by both key and value
Usage
string key_implode(string $pair_glue, string $glue, array $arr)
Given an associative array, key_implode() returns a string where both the keys and the values have been imploded by a specified glue.
key_implode(':', '/', [ 'page' => 2, 'letter' => 'A' ]); // page:2/letter:A
Installation
The easiest way to install this library is to use Composer and add the following to your project's composer.json.
{
"require": {
"nathggns/key_implode": "1.1.*"
}
}
Then, when you run composer install, Composer should add this function to your project.
You do not need Composer to use this project, though. The alternative is to simply take the file src/key_implode.php and add it to your project.