Re: [PHP] isodd() php5?



At 9:32 AM +0000 10/30/07, Hulf wrote:
Hi,

Is there a built in function in PHP5 to determine if an integer is even or
odd?

Ross


Try:

echo($integer & 1);

1 = odd, 0 = even.

Cheers,

tedd


--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
.



Relevant Pages

  • isodd() php5?
    ... Is there a built in function in PHP5 to determine if an integer is even or ... Ross ...
    (php.general)
  • Re: [PHP] isodd() php5?
    ... At 09:32 30/10/2007, Hulf wrote: ... Is there a built in function in PHP5 to determine if an integer is even or ...
    (php.general)
  • Re: Rust and stuff
    ... I do wipe them after a round of golf in the wet and they ... My forged John Letter Master Models have sat in the shed for much of the last 40 odd years and still have not rusted, though close examination might elicit the odd 'sorty of rusty deposit'. ... Indeed, but they were probably made when things were built to last, I enjoyed reading up about them on the Letters web site, I think there's built in obsolescence these days. ...
    (uk.sport.golf)
  • Re: 2.6.23-git Kconfig regression
    ... And that git7 thing doesn't look _quite_ so odd. ... tristate options individually if the choice gets set to M, ... boolean selection if the choice gets set to Y. ... it) or any one of them to be built in (the current behavior, ...
    (Linux-Kernel)
  • Re: Top Gear - Bugatti Veyron...
    ... > I just built a pc for the telly. ... Makes watching vids so much easier. ... Mine's just gone a bit odd - overheating, been fine for two years - I think ...
    (uk.rec.cars.modifications)