I created a PHP value for a view to calculate the number of days between two dates. These dates range from negative values (-303) to positive values (422). This field is referenced as $row->php.

I'm trying to filter on those PHP value field for all values greater than 0. I can't seem to get it to work.

This is the code I am using so far.

$value = $data->php['0']['raw']['value'];
$num = (int)$value;
if ($num > 0) {
  return TRUE;   

Can anyone see what the issue is?

  • Have you tried just return intval($data->php['0']['raw']['value']) > 0; ?
    – Kevin
    Jun 17 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.