16

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,010
  • 13
  • 100
  • 141
Jake
  • 24,303
  • 27
  • 100
  • 159

1 Answers1

63
echo $objectName->{'key-west'};
nc3b
  • 14,524
  • 5
  • 49
  • 63