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


php object undefined index - cannot get value

我有一个对象,我的问题是我不能得到我需要的所有值,有些工作很好,有些没有。

由于某种原因我无法访问消息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"]=>

我解决了。

这是因为该变量是受保护的,通过将其设置为公共来解决这个问题。