0

I have an object which has a property called "Employee-ID";

Im trying to get its value by:

echo ($row->Employee-ID);

But PHP keeps saying:

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

I just have the problem with this propert which has "-" in between; how can I solve this problem?

Thanks

1 Answers1

6

Same as always.

$row->{'Employee-ID'}
Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358