X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FArray.php;h=f4938febf89bfe95ae21931c55d724e10b18a98b;hb=f58d84b73435283fbd3d34c1ce06e2d6c7000b70;hp=42b355f3d07a31c21f74172369874ad1ed470941;hpb=9ac4f6998bc411f30a94d7764140f6bcd7decaf7;p=civicrm-core.git diff --git a/CRM/Utils/Array.php b/CRM/Utils/Array.php index 42b355f3d0..f4938febf8 100644 --- a/CRM/Utils/Array.php +++ b/CRM/Utils/Array.php @@ -1,7 +1,7 @@ ['email' => ['location' => 'llama']] + * + * @param $path + * @param $value + * + * @return array + */ + public static function recursiveBuild($path, $value) { + $arrayKey = array_shift($path); + return [$arrayKey => (empty($path) ? $value : self::recursiveBuild($path, $value))]; + } + }