I have the following code:
// evaluates to negative numbers, i.e. -2
$group_vids_count = $_videos->countGroupVids($series['id']) - 3;
if ( $group_vids_count > 0 )
{
$xmore = $group_vids_count . ' is more';
}
else
{
$xmore = $group_vids_count;
}
Everything works as expected if $group_vids_count evaluates to a positive number. As far as it evaluates to a negative number, like -2 I still get results as if $group_vids_count > 0, although -2 is < 0…
$_videos->countGroupVids($series['id']) - 3 is intended as there are 3 videos displayed directly. I need to find out how many more there are…
I have tried to use max() but still the same issue…
I cannot reproduce that problem, see this codepad example. Are you sure
$group_vids_countis actually negative?