Hyphens in Keys of Object
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
echo $objectName->{'key-west'};
链接地址: http://www.djcxy.com/p/59546.html
上一篇: {}标记回显“{$ e
下一篇: 对象的关键字中的连字符