I am trying to do something like htis
foreach ($_POST as $key => $value)
{
$newNode->field_$key['und'][0]['value'] = $value;
}
php complains of Parse error: syntax error, unexpected T_VARIABLE
I tried
foreach ($_POST as $key => $value)
{
$newNode->field_{$key}['und'][0]['value'] = $value;
}
But then key is output as an array. Not sure why.
Any tips?