In this code :
$structuredData->setRow_1__column_1($var1);
is there a way to replace Row_1
by a variable $row
?
PHP supports variable functions, meaning you can use a variable that contains a sting + parentheses to call a function with that name. Here's how that works in your case:
$row = 'Row_6';
$setRow = "set{$row}__column_1";
$structuredData->$setRow($var1);