Re: If value is odd or not
| From: | Dimiter Ivanov | Date: | Fri, 02 Jun 2006 14:14:23 +0000 |
| Subject: | Re: If value is odd or not | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237271@lists.php.net to get a copy of this message | ||
I doubt that Jonas ever expected 'the rain of answers' that will
follow his humble question ;]
On 6/2/06, tedd <tedd@sperling.com> wrote:
At 3:32 PM +0200 6/2/06, Jonas Rosling wrote: Hi all, is there any easy why to check if a value is odd or not? Jonas: echo($num & 1); This produces 1 for odd and 0 for even. tedd -- ------------------------------------------------------------------------------------ http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php