Search code examples
phpmysqlobjectwhitespace

return object value with space in key


just come across something I've never came across before. I have a value in my table "Device Vendor" and i am returning the data os an object.

usually I would call $ob->var_name but obviously $ob->Device Vendor will not work.

How do I return the value?

Regards


Solution

  • You use the following syntax

     $ob->{'Device Vendor'}