| @@ 398-404 (lines=7) @@ | ||
| 395 | ||
| 396 | $results = []; |
|
| 397 | ||
| 398 | foreach ($array as $key => $value) { |
|
| 399 | if (is_array($value)) { |
|
| 400 | $results = array_merge($results, $this->dot($value, $prepend . $key . '.')); |
|
| 401 | } else { |
|
| 402 | $results[$prepend . $key] = $value; |
|
| 403 | } |
|
| 404 | } |
|
| 405 | ||
| 406 | return $this->dotted[$cache] = $results; |
|
| 407 | } |
|
| @@ 422-428 (lines=7) @@ | ||
| 419 | { |
|
| 420 | $flattened = []; |
|
| 421 | ||
| 422 | foreach ($array as $key => $value) { |
|
| 423 | if (is_array($value)) { |
|
| 424 | $flattened = array_merge($flattened, $this->flatten($value, $separator, $prepend . $key . $separator)); |
|
| 425 | } else { |
|
| 426 | $flattened[$prepend . $key] = $value; |
|
| 427 | } |
|
| 428 | } |
|
| 429 | ||
| 430 | return $flattened; |
|
| 431 | } |
|