1

使用 Zend amazon 服务,我一直到那里。

$url=$result->LargeImage->Url;
print_r($url);

这个的输出是:

Zend_Uri_Http Object
(
    [_username:protected] => 
    [_password:protected] => 
    [_host:protected] => ecx.images-amazon.com
    [_port:protected] => 
    [_path:protected] => /images/I/41voDxJS62L.jpg
    [_query:protected] => 
    [_fragment:protected] => 
    [_regex:protected] => Array
        (
            [escaped] => %[[:xdigit:]]{2}
            [unreserved] => [A-Za-z0-9-_.!~*'()\[\]]
            [segment] => (?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\]:@&=+$,;])*
            [path] => (?:\/(?:(?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\]:@&=+$,;])*)?)+
            [uric] => (?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\];\/?:@&=+$,])
        )

    [_scheme:protected] => http
)

我们不能 echo $url->_host:protected 在这里做,因为 'protected' 是关键字。

我如何访问它?有人可以帮忙吗?

谢谢

4

1 回答 1

3

使用吸气剂。

$result->LargeImage->Url->getHost()

或者

$url->getHost()

请参阅文档: http: //framework.zend.com/apidoc/1.9/Zend_Uri/Zend_Uri_Http.html

于 2012-06-11T15:06:42.293 回答