您要问的是所谓的Variable Variables。您需要做的就是将字符串存储在变量中,然后像这样访问它:$Class = 'MyCustomClass';$Property = 'Name';$List = array('Name');$Object = new $Class();// All of these will echo the same propertyecho $Object->$Property; // Evaluates to $Object->Nameecho $Object->{$List[0]}; // Use if your variable is in an array