Skip to content

Kirby 6.0.1

A::extend()

Merges arrays recursively; values of the same key are combined, not overwritten (use A::merge() for that)

A::extend(array ...$arrays): array

Parameters

Name Type Default
...$arrays array no default value

Return type

array

Parent class

Kirby\Toolkit\A

Examples

$array = A::extend(
  ['tags' => ['php'], 'cms' => 'kirby'],
  ['tags' => ['js']]
);
// returns: ['tags' => ['php', 'js'], 'cms' => 'kirby']