How to do that inside the value box using the $row->field_name variable ?!

Thanks.

Comments

sadashiv’s picture

You may use the code as

if(trim($row->field_name) == ""){
  //SOME CODE TO SET VALUE
}
else{
  //SOME CODE TO SET VALUE
}
//RETURN THE VALUE TO BE USED IN OUTPUT

Hth,
Sadashiv.

W.M.’s picture

Thanks Sadashiv,

Your suggested idea (using trim) did not work using the $row->field_name variable inside Views PHP field, however it did work in another context which is: View header (Global text with php filter enabled) using replacement tokens from first row (that is, via using replacement tokens to generate php variables (to be passed to trim), corresponding to field outputs, from first row).