Michael Schinis
Michael Schinis

Reputation: 697

Can't access php values inside an object

I have an object that has keys with '.' character inside them..

How can I access them properly using just the $var->site.title

Is there a way to do that, sticking to the object method?

Upvotes: 0

Views: 58

Answers (1)

user142162
user142162

Reputation:

Using the variable variables syntax:

$obj->{"site.title"}

Upvotes: 5

Related Questions