| @@ 781-787 (lines=7) @@ | ||
| 778 | ||
| 779 | $results = []; |
|
| 780 | ||
| 781 | foreach ($array as $key => $value) { |
|
| 782 | if (is_array($value)) { |
|
| 783 | $results = array_merge($results, static::dot($value, $prepend . $key . '.')); |
|
| 784 | } else { |
|
| 785 | $results[$prepend . $key] = $value; |
|
| 786 | } |
|
| 787 | } |
|
| 788 | ||
| 789 | return self::$dotted[$cache] = $results; |
|
| 790 | } |
|
| @@ 834-840 (lines=7) @@ | ||
| 831 | { |
|
| 832 | $flattened = []; |
|
| 833 | ||
| 834 | foreach ($array as $key => $value) { |
|
| 835 | if (is_array($value)) { |
|
| 836 | $flattened = array_merge($flattened, static::flatten($value, $separator, $prepend . $key . $separator)); |
|
| 837 | } else { |
|
| 838 | $flattened[$prepend . $key] = $value; |
|
| 839 | } |
|
| 840 | } |
|
| 841 | ||
| 842 | return $flattened; |
|
| 843 | } |
|