Accessing Class Properties with Spaces

Kemal Fadillah picture Kemal Fadillah · Aug 11, 2011 · Viewed 14.1k times · Source

stdClass Object ([Sector] => Manufacturing [Date Found] => 2010-05-03 08:15:19)

So I can access [Sector] by using $object->Sector but how can I access [Date Found] ?

Answer

Imi Borbas picture Imi Borbas · Aug 11, 2011

You can do it this way:

$object->{'Date Found'}