I doubt that Jonas ever expected 'the rain of answers' that will
follow his humble question ;]

On 6/2/06, tedd <[EMAIL PROTECTED]> 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



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to