php对象未定义索引 - 无法获取值

时间:2014-05-26 13:07:42

标签: php arrays object

我有一个对象,我的问题是我无法获得我需要的所有值,有些工作正常,有些则没有。

由于某些原因我无法访问消息ID,如何获取值?

我不太明白为什么它在数组中得到一个* _,所以对它的解释是适用的

数组来自zend框架,我已经提交了一些数组,我可以访问,从而没有问题。

    array(11) {
  ["*_flags"]=>
  array(1) {
    ["\Seen"]=>
    string(5) "\Seen"
  }
  ["*_messageid"]=>
  string(16) "14629efe3be48bdf"
  ["*_headers"]=>
  array(15) {
    ["delivered-to"]=>
    string(26) "testformaalsmail@gmail.com"
    ["received"]=>
    array(3) {
      [0]=>
      string(84) "by 10.229.169.203 with SMTP id a11csp39240qcz; Fri, 23 May 2014 09:35:26 -0700 (PDT)"
      [1]=>
      string(197) "from phpclasses.org (phpclasses.org. [216.240.132.150]) by mx.google.com with SMTP id kq7si4570929pbc.143.2014.05.23.09.35.24 for ; Fri, 23 May 2014 09:35:25 -0700 (PDT)"
      [2]=>
      string(60) "(qmail 27874 invoked by uid 500); 23 May 2014 16:02:30 -0000"
    }
    ["x-received"]=>
    string(100) "by 10.69.31.11 with SMTP id ki11mr7536275pbd.88.1400862925656; Fri, 23 May 2014 09:35:25 -0700 (PDT)"
    ["return-path"]=>
    string(50) ""
    ["received-spf"]=>
    string(151) "pass (google.com: domain of errors-testformaalsmail=gmail.com@phpclasses.org designates 216.240.132.150 as permitted sender) client-ip=216.240.132.150;"
    ["authentication-results"]=>
    string(202) "mx.google.com; spf=pass (google.com: domain of errors-testformaalsmail=gmail.com@phpclasses.org designates 216.240.132.150 as permitted sender) smtp.mail=errors-testformaalsmail=gmail.com@phpclasses.org"
    ["date"]=>
    string(26) "23 May 2014 16:02:30 -0000"
    ["to"]=>
    string(40) "test bruger "
    ["subject"]=>
    string(50) "[PHP Classes] New class daily digest of 2014-05-22"
    ["from"]=>

1 个答案:

答案 0 :(得分:0)

我解决了。

这是因为变量受到保护,这是通过将其公开来修复的。