Jump to content

Dealing with negative numbers


lanu

Recommended Posts

<?php

if ($beyondportal % 26 == 0 || $beyondportal == 0){ ?>

MY CONTENT

<?php } ; ?>

 

 

This code compares my variable $beyondportal and if it is a multiple of 26 counting up from 0, it prints my content.

 

This is great but sometimes the number comes up a negative that is a multiple counting down from 0 like  -26, -52, etc..

 

if I could do the opposite of a modulus I would think it would work but I'm not sure how to in php. any suggestions?

Link to comment
https://forums.phpfreaks.com/topic/253787-dealing-with-negative-numbers/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.