@@ 393-399 (lines=7) @@ | ||
390 | ||
391 | $results = []; |
|
392 | ||
393 | foreach ($array as $key => $value) { |
|
394 | if (is_array($value)) { |
|
395 | $results = array_merge($results, $this->dot($value, $prepend . $key . '.')); |
|
396 | } else { |
|
397 | $results[$prepend . $key] = $value; |
|
398 | } |
|
399 | } |
|
400 | ||
401 | return $this->dotted[$cache] = $results; |
|
402 | } |
|
@@ 417-423 (lines=7) @@ | ||
414 | { |
|
415 | $flattened = []; |
|
416 | ||
417 | foreach ($array as $key => $value) { |
|
418 | if (is_array($value)) { |
|
419 | $flattened = array_merge($flattened, $this->flatten($value, $separator, $prepend . $key . $separator)); |
|
420 | } else { |
|
421 | $flattened[$prepend . $key] = $value; |
|
422 | } |
|
423 | } |
|
424 | ||
425 | return $flattened; |
|
426 | } |