| @@ 359-365 (lines=7) @@ | ||
| 356 | ||
| 357 | $results = []; |
|
| 358 | ||
| 359 | foreach ($array as $key => $value) { |
|
| 360 | if (is_array($value)) { |
|
| 361 | $results = array_merge($results, $this->dot($value, $prepend . $key . '.')); |
|
| 362 | } else { |
|
| 363 | $results[$prepend . $key] = $value; |
|
| 364 | } |
|
| 365 | } |
|
| 366 | ||
| 367 | return $this->dotted[$cache] = $results; |
|
| 368 | } |
|
| @@ 383-389 (lines=7) @@ | ||
| 380 | { |
|
| 381 | $flattened = []; |
|
| 382 | ||
| 383 | foreach ($array as $key => $value) { |
|
| 384 | if (is_array($value)) { |
|
| 385 | $flattened = array_merge($flattened, $this->flatten($value, $separator, $prepend . $key . $separator)); |
|
| 386 | } else { |
|
| 387 | $flattened[$prepend . $key] = $value; |
|
| 388 | } |
|
| 389 | } |
|
| 390 | ||
| 391 | return $flattened; |
|
| 392 | } |
|