public static function setNestedValue(array &$array, array $keys, $value)
    {
        $current = &$array;
        foreach ($keys as $key) {
            if (!isset($current[$key])) {
                $current[$key] = [];
            }
            $current = &$current[$key];
        }
        $current = $value;
    }
public static function setNestedValue(array &$array, array $keys, $value)
    {
        $current = &$array;
        foreach ($keys as $key) {
            if (!isset($current[$key])) {
                $current[$key] = [];
            }
            $current = &$current[$key];
        }
        $current = $value;
    }
public static function setNestedValue ( array & $ array , array $ keys , $ value ) { $ current = & $ array ; foreach ( $ keys as $ key ) { if ( ! isset ( $ current [ $ key ] ) ) { $ current [ $ key ] = [ ] ; } $ current = & $ current [ $ key ] ; } $ current = $ value ; }
Setting nested value.

Example:
<code>
$array = array();
Arrays::setNestedValue($array, array('1', '2', '3'), 'value');
</code>
Result:
<code>
Array
(
[1] => Array
(
[2] => Array
(
[3] => value
)
)
)
</code>

@param array $array
@param array $keys
@param $value
Setting nested value .