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