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

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

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