Grid | Change field style with array

any idea how it works ?


$arr = array (‘field_1’, ‘field_2’);

foreach ($arr as $field_name)

{
if ($this -> $field_name = 0)
{
sc_field_style ($field_name, ‘’, ‘’, ‘#CF5353’, ‘’, ‘bold’);
}
else
{
}
}


above code generates no errors, but the style doesn’t change ? btw, all fields are integers.

$this -> $field_name == 0 I guess you wanted that…

tried that as well, didn’t work !!

sometimes you need a quote around the number
and i see you have } extra

for the color in grid it didn’t work with me unless I add the “else” as well