Nicholas Nicholas - 1 month ago 5
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

Try this, Best way for single value

echo $objects->{"0"};

and for multiple values

foreach($objects as $val )
{
    echo $val;
}