public function getValueSegmented($object, $key, $default)
    {
        if (is_null($key) || trim($key) == '') {
            return $default;
        }

        foreach (explode('.', $key) as $segment) {
            $object = is_array($object) ? (object) $object : $object;
            if (!isset($object->{$segment})) {
                return $default;
            }

            $object = $object->{$segment};
        }

        return $object;
    }
public function getValueSegmented($object, $key, $default)
    {
        if (is_null($key) || trim($key) == '') {
            return $default;
        }

        foreach (explode('.', $key) as $segment) {
            $object = is_array($object) ? (object) $object : $object;
            if (!isset($object->{$segment})) {
                return $default;
            }

            $object = $object->{$segment};
        }

        return $object;
    }
public function getValueSegmented ( $ object , $ key , $ default ) { if ( is_null ( $ key ) || trim ( $ key ) == '' ) { return $ default ; } foreach ( explode ( '.' , $ key ) as $ segment ) { $ object = is_array ( $ object ) ? ( object ) $ object : $ object ; if ( ! isset ( $ object -> { $ segment } ) ) { return $ default ; } $ object = $ object -> { $ segment } ; } return $ object ; }
Get Value of segment.

@param $object
@param $key
@param $default

@return mixed
Get Value of segment .