| @@ 399-405 (lines=7) @@ | ||
| 396 | ||
| 397 | $results = []; |
|
| 398 | ||
| 399 | foreach ($array as $key => $value) { |
|
| 400 | if (is_array($value)) { |
|
| 401 | $results = array_merge($results, $this->dot($value, $prepend . $key . '.')); |
|
| 402 | } else { |
|
| 403 | $results[$prepend . $key] = $value; |
|
| 404 | } |
|
| 405 | } |
|
| 406 | ||
| 407 | return $this->dotted[$cache] = $results; |
|
| 408 | } |
|
| @@ 452-458 (lines=7) @@ | ||
| 449 | { |
|
| 450 | $flattened = []; |
|
| 451 | ||
| 452 | foreach ($array as $key => $value) { |
|
| 453 | if (is_array($value)) { |
|
| 454 | $flattened = array_merge($flattened, $this->flatten($value, $separator, $prepend . $key . $separator)); |
|
| 455 | } else { |
|
| 456 | $flattened[$prepend . $key] = $value; |
|
| 457 | } |
|
| 458 | } |
|
| 459 | ||
| 460 | return $flattened; |
|
| 461 | } |
|