| @@ 182-188 (lines=7) @@ | ||
| 179 | ||
| 180 | $results = []; |
|
| 181 | ||
| 182 | foreach ($array as $key => $value) { |
|
| 183 | if (is_array($value)) { |
|
| 184 | $results = array_merge($results, $this->dot($value, $prepend . $key . '.')); |
|
| 185 | } else { |
|
| 186 | $results[$prepend . $key] = $value; |
|
| 187 | } |
|
| 188 | } |
|
| 189 | ||
| 190 | return $this->dotted[$cache] = $results; |
|
| 191 | } |
|
| @@ 206-212 (lines=7) @@ | ||
| 203 | { |
|
| 204 | $flattened = []; |
|
| 205 | ||
| 206 | foreach ($array as $key => $value) { |
|
| 207 | if (is_array($value)) { |
|
| 208 | $flattened = array_merge($flattened, $this->flatten($value, $separator, $prepend . $key . $separator)); |
|
| 209 | } else { |
|
| 210 | $flattened[$prepend . $key] = $value; |
|
| 211 | } |
|
| 212 | } |
|
| 213 | ||
| 214 | return $flattened; |
|
| 215 | } |
|