Creates an associative array using a $path1 as the path to build its keys, and optionally
$path2 as path to get the values. If $path2 is not specified, all values will be
initialized to null (useful for Set::merge()). You can optionally group the values by
what is obtained when following the path specified in $groupPath.
public static combine ( array $data, mixed $path1 = null, mixed $path2 = null, string $groupPath = null ) : array | ||
$data | array | Array from where to extract keys and values. |
$path1 | mixed | As an array, or as a dot-delimited string. |
$path2 | mixed | As an array, or as a dot-delimited string. |
$groupPath | string | As an array, or as a dot-delimited string. |
return | array | Combined array. |