php - Access variable of stdClass Object -


i using laravel select statement select row highest id this:

$user_id = db::connection('mysql2')->select('select max(id) users')[0]; 

this returns array object looks this:

stdclass object ( [max(id)] => 11 ) 1 

i have tried $object->max(id) , $object['max(id)'] not seem work.

dynamic attributes not allowed characters can accessed using curly brackets this:

$object->{"max(id)"} 

Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -