Nicholas Nicholas - 1 year ago 96
PHP Question

How to get object(stdClass) value in php?

I have some object like this :

object(stdClass)#188 (1) { ["0"]=> string(1) "1" }

How could I print that object value in php ?

Thank you.

Answer Source

Try this, Best way for single value

echo $objects->{"0"};

and for multiple values

foreach($objects as $val )
    echo $val;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download