Change output of a field with PHP field? I'm constructing a view in Drupal 7 with a field called "Content: Fruit". If the value of that field is "lemon", I want to change the output to "citrus". How can I accomplish this?

Here's what I tried:

First, I excluded the "Content: Fruit" field from the display. Then I added a "Global: PHP" field after it where, in the "Value code" section, I added:

return $row-&gt;field_fruit;

Then in the "Output code" section I added:

&lt;?php  
    if ($value == 'lemon') {
        print 'citrus';
    }
?&gt;


This doesn't work. The value of $value seems to be the node ID ("nid").

Thought this would be straightforward... what am I doing wrong here? Is there a better way to accomplish this?
it looks like you have the logic a little backwards:

Value Code:

if($row-&gt;field_fruit == 'lemon') return 'citrus';

Output Code:

&lt;?php print $value; ?&gt;