Conditional PHP works in Node Template but not in Views Custom Fields This code in my node template checks a CCK field and prints some text dependent on the value: 

&lt;?php if ($node-&gt;field_stock[0]['view'] == 'No' ) : ?&gt;
&lt;div id="out-stock-my"&gt;&lt;h2&gt;Out of Stock&lt;/h2&gt;&lt;/div&gt;
&lt;?php endif; ?&gt;


How can I do something similar with Views Custom Field's PHP filed type? 
Thanks
If 'm not mistaken you are trying to move this logic out of your tpl.php template file by using views custom field. 

You first need to get the name of the accessible fields with this code.

&lt;?php print var_export($data, TRUE); ?&gt;


Then you should be able input in the custom field something similar to this. 

&lt;?php if ($data-&gt;field_stock == 'No' ) : ?&gt;
&lt;div id="out-stock-my"&gt;&lt;h2&gt;Out of Stock&lt;/h2&gt;&lt;/div&gt;
&lt;?php endif; ?&gt;


There is more info here http://drupal.org/node/467190.