The Views Custom Field module makes Views highly customizable. You create a HTML markup or PHP code snippet as a field which could retrieve and manipulate any data from the database.
After installation, you can add a Customfield in Views UI.

You can either insert HTML markup, PHP code snippet or the row number as field for each data row.
Done =)
Reference: Drupal Module – Views Custom Field

One thought on “Drupal – Custom PHP code for Views Field”