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