使用空格访问类属性 [英] Accessing Class Properties with Spaces
本文介绍了使用空格访问类属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
stdClass Object([Sector] => Manufacturing [Date Found] => 2010-05-03 08:15:19)
所以我可以通过使用 $ object-> Sector
来访问 [Sector]
但如何访问 [找到日期]
?
So I can access [Sector]
by using $object->Sector
but how can I access [Date Found]
?
推荐答案
这样做:
$object->{'Date Found'}
这篇关于使用空格访问类属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文