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