| @@ 773-779 (lines=7) @@ | ||
| 770 | ||
| 771 | $results = []; |
|
| 772 | ||
| 773 | foreach ($array as $key => $value) { |
|
| 774 | if (is_array($value)) { |
|
| 775 | $results = array_merge($results, static::dot($value, $prepend . $key . '.')); |
|
| 776 | } else { |
|
| 777 | $results[$prepend . $key] = $value; |
|
| 778 | } |
|
| 779 | } |
|
| 780 | ||
| 781 | return self::$dotted[$cache] = $results; |
|
| 782 | } |
|
| @@ 826-832 (lines=7) @@ | ||
| 823 | { |
|
| 824 | $flattened = []; |
|
| 825 | ||
| 826 | foreach ($array as $key => $value) { |
|
| 827 | if (is_array($value)) { |
|
| 828 | $flattened = array_merge($flattened, static::flatten($value, $separator, $prepend . $key . $separator)); |
|
| 829 | } else { |
|
| 830 | $flattened[$prepend . $key] = $value; |
|
| 831 | } |
|
| 832 | } |
|
| 833 | ||
| 834 | return $flattened; |
|
| 835 | } |
|