Re: If value is odd or not
| From: | Jochem Maas | Date: | Fri, 02 Jun 2006 13:42:37 +0000 |
| Subject: | Re: If value is odd or not | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237261@lists.php.net to get a copy of this message | ||
Jonas Rosling wrote:
Hi all, is there any easy why to check if a value is odd or not?the modulos operator: read about what it does here: http://php.net/manual/en/language.operators.arithmetic.php here is a simple example of how to check if something is odd or not (odd number that is ;-): $x = 1; $y = 2; $z = 3; var_dump(($x % 2), ($y % 2), ($z % 2));
Thanks // Jonas