mySql PHP - return object value with space in key

Phil Jackson picture Phil Jackson · Jul 11, 2011 · Viewed 7.8k times · Source

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

Answer

Paul Dixon picture Paul Dixon · Jul 11, 2011

You use the following syntax

 $ob->{'Device Vendor'}