19

I have an stdClass Object like this:

stdClass Object ( [key-west] => 1 [disney-land] => 1 ) 

I am trying to retrieve the value like this:

$objectName->key-west

but the value returned is 0. Why? and How can I retrieve it as 1?

Thanks

Charles
  • 50,943
  • 13
  • 104
  • 142
Jake
  • 25,479
  • 31
  • 107
  • 168

1 Answers1

72
echo $objectName->{'key-west'};
nc3b
  • 15,562
  • 5
  • 51
  • 63