I suddenly stuck here:
$source = (object) array(
'field_phone' => array(
'und' => array(
'0' => array(
'value' => '000-555-55-55',
),
),
),
);
dsm($source);
$source_field = "field_phone['und'][0]['value']";
dsm($source->{$source_field}); //This notation doesn't work
dsm($source->field_phone['und'][0]['value']); //This does
dsm()
is Drupal developer function for debug printing variables, objects and arrays.
Why $source
object doesn't understand $obj->{$variable}
notation?
Notice: Undefined property: stdClass::$field_phone['und']['0']['value']