@@ 321-327 (lines=7) @@ | ||
318 | ||
319 | $results = []; |
|
320 | ||
321 | foreach ($array as $key => $value) { |
|
322 | if (is_array($value)) { |
|
323 | $results = array_merge($results, $this->dot($value, $prepend . $key . '.')); |
|
324 | } else { |
|
325 | $results[$prepend . $key] = $value; |
|
326 | } |
|
327 | } |
|
328 | ||
329 | return $this->dotted[$cache] = $results; |
|
330 | } |
|
@@ 345-351 (lines=7) @@ | ||
342 | { |
|
343 | $flattened = []; |
|
344 | ||
345 | foreach ($array as $key => $value) { |
|
346 | if (is_array($value)) { |
|
347 | $flattened = array_merge($flattened, $this->flatten($value, $separator, $prepend . $key . $separator)); |
|
348 | } else { |
|
349 | $flattened[$prepend . $key] = $value; |
|
350 | } |
|
351 | } |
|
352 | ||
353 | return $flattened; |
|
354 | } |