| @@ 294-300 (lines=7) @@ | ||
| 291 | ||
| 292 | $results = []; |
|
| 293 | ||
| 294 | foreach ($array as $key => $value) { |
|
| 295 | if (is_array($value)) { |
|
| 296 | $results = array_merge($results, $this->dot($value, $prepend . $key . '.')); |
|
| 297 | } else { |
|
| 298 | $results[$prepend . $key] = $value; |
|
| 299 | } |
|
| 300 | } |
|
| 301 | ||
| 302 | return $this->dotted[$cache] = $results; |
|
| 303 | } |
|
| @@ 318-324 (lines=7) @@ | ||
| 315 | { |
|
| 316 | $flattened = []; |
|
| 317 | ||
| 318 | foreach ($array as $key => $value) { |
|
| 319 | if (is_array($value)) { |
|
| 320 | $flattened = array_merge($flattened, $this->flatten($value, $separator, $prepend . $key . $separator)); |
|
| 321 | } else { |
|
| 322 | $flattened[$prepend . $key] = $value; |
|
| 323 | } |
|
| 324 | } |
|
| 325 | ||
| 326 | return $flattened; |
|
| 327 | } |
|