How can I enable Global: PHP field
Just install the Views PHP module and you can now add a &quot;Global: PHP field&quot; to your views that can include PHP code. Quote from its project page:

This module allows the admin account (user 1) to add fields, filters and sorts to views which use PHP code. It also supports additional accounts when the core PHP Filter module is enabled.
Note: While this module allows you to directly use PHP inside views which may be useful for quick and easy solutions, it is highly
advisable to use regular handlers and plugins when available (or even
to create one yourself). Take note that filtering and sorting a view
using PHP always has a considerable perfomance impact.