public static function targetSet($needle, $value, array $haystack = array())
    {
        $keys = explode('.', $needle);
        $loop = &$haystack;

        foreach ($keys as $key) {
            if (is_array($loop) === false) {
                $loop = array();
            }

            if (array_key_exists($key, $loop) === false) {
                $loop[$key] = array();
            }

            $loop = &$loop[$key];
        }

        $loop = $value;

        return $haystack;
    }
public static function targetSet($needle, $value, array $haystack = array())
    {
        $keys = explode('.', $needle);
        $loop = &$haystack;

        foreach ($keys as $key) {
            if (is_array($loop) === false) {
                $loop = array();
            }

            if (array_key_exists($key, $loop) === false) {
                $loop[$key] = array();
            }

            $loop = &$loop[$key];
        }

        $loop = $value;

        return $haystack;
    }
public static function targetSet ( $ needle , $ value , array $ haystack = array ( ) ) { $ keys = explode ( '.' , $ needle ) ; $ loop = & $ haystack ; foreach ( $ keys as $ key ) { if ( is_array ( $ loop ) === false ) { $ loop = array ( ) ; } if ( array_key_exists ( $ key , $ loop ) === false ) { $ loop [ $ key ] = array ( ) ; } $ loop = & $ loop [ $ key ] ; } $ loop = $ value ; return $ haystack ; }
Set an value on a multi dimensional array via a dotted string notation

@param  string $needle
@param  string $value
@param  array  $haystack

@return array
Set an value on a multi dimensional array via a dotted string notation