php use an object as key code example Example: php use variable as object key $nid_property = 'my_nid'; $nid = $row->{$nid_property};