Check if field has value (content) I have code which checks if field exists, but I try to change it to check if field has value (content) or not.

In views I have one field to show all content (Rewrite results). So all fields are loaded always. Thats why I need code which checks does field have content or not.

This is what I got now, but it adds "has_no_field" to all - no matter if field_image has content or not.

function theme_preprocess_views_view_unformatted(&amp;$vars) {
  $view = $vars['view'];
  $rows = $vars['rows'];

foreach ($vars['view']-&gt;result as $id =&gt; $row) {

    if (isset($row-&gt;field_image['und'][0]['value']) == 1) {
      $vars['classes_array'][$id] = 'has_field';
    }  
    else {
      $vars['classes_array'][$id] = 'has_no_field';
    }
  }
}
Try changing 

if (isset($row-&gt;field_image['und'][0]['value']) == 1) {


to 

if (!empty($row-&gt;field_field_image)) {