in a for each loop, i have an array going through with $key=>$value.
for every $key values of the array, there is a variable with the same exact name that i’d like to be populated with the $value.
foreach($Station_Info as $key=>$value)
$this->{$key} = $value;
where {$key} is, i’d like for some how it reference the variable. again, each $key value is the same as every variable name in that class.
edit: what’s useful about what i’m doing is that i won’t have to do this:
$this->StationID = $Station_info[‘StationID ‘];
$this->Name = $Station_info[‘Name’];
$this->Address = $Station_info[‘Address’];
$this->City = $Station_info[‘City’];
… continue for 15 more lines