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

android - questions about switching from C2DM to GCM -

c++ - rosrun via ssh doesnt start a node properly -

Error C2280 mutex in a class C++ -