Skip to content

Instantly share code, notes, and snippets.

@sidneydemoraes
Last active November 22, 2018 20:04
Show Gist options
  • Save sidneydemoraes/ac14b8c5d8a7918c3f6a1e8e0b0e1bd7 to your computer and use it in GitHub Desktop.
Save sidneydemoraes/ac14b8c5d8a7918c3f6a1e8e0b0e1bd7 to your computer and use it in GitHub Desktop.
Implosão Recursiva de Array PHP
<?php
function multi_implode($array, $parent = '') {
$ret = '';
foreach ($array as $key => $value) {
if (is_array($value)) {
$ret .= multi_implode($value, $parent . $key . '=>');
} else {
$ret .= $parent . $key . '=>' . $value . "\n";
}
}
return $ret;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment