Maybe $field['YOUR_FIELD']->content
is printing fields data with the extra markup added by views module.
If that is the case, make sure that your view is printing only the field markup without any wrapper elements. From your view administration page admin/structure/views/view/VIEW_ID
loop through all your fields.
From Style settings
; check Customize field HTML
and Customize field and label wrapper HTML
, and change the value of HTML element
to - None -
.