Is it possible to add PHP code in Global: Custom Text? I have two links to redirect based on if a field is empty or not. Now I use the Global text setting to create a link for redirection with A basic &lt;a&gt; tag.

How can I add PHP code in a view to verify the field is empty?
First, install the Views PHP module and you can now add a "Global: PHP field" to your views that can include PHP code.

Then add your condition field first in your view and after that your PHP field, so that the condition field value is included in available tokens.

The code of your PHP field should be sth like this:

  &lt;?php    
      if ($field_test) { // use the field token here and check if empty
       return '&lt;a href="$url1"&gt;Exists&lt;/a&gt;'; 
      } else { 
       return '&lt;a href="$url2"&gt;Not exists&lt;/a&gt;'; 
      }  
   ?&gt;


See also:

How can I enable Global: PHP field

add Global PHP code field to Views on condition