Score:0

Filter on PHP value

us flag

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?

Kevin avatar
in flag
Have you tried just `return intval($data->php['0']['raw']['value']) > 0;` ?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.