How to get object like value:item:private from PHP Array

后端 未结 1 1362
不知归路
不知归路 2020-12-22 14:24

I have the array like this:

} [\"items\":\"Jcart\":private]=> array(3) { [0]=> string(1) \"3\" [1]=> string(1) \"2\"

相关标签:
1条回答
  • 2020-12-22 14:34

    I assume you got this by casting an object to an array. If that's the case, you shouldn't be doing that! The property is private because you're not supposed to access it directly because it's not a public API. The object should have a public method which you're supposed to call instead, that's the public API. Something like $foo->getItems() or such. Read the documentation and/or source code.

    0 讨论(0)
提交回复
热议问题