如何获取名称之间有短划线(-)的对象的属性


How to get the property of an object which has a dash (-) in between name

我有一个对象,它有一个名为"Employee ID"的属性;

我试图通过来获得它的价值

echo ($row->Employee-ID);

但PHP一直在说:

Undefined property: stdClass::$Employee
 Use of undefined constant ID - assumed 'ID' 

我只是对这个介于"-"之间的属性有问题;我该如何解决这个问题?

感谢

一如既往。

$row->{'Employee-ID'}