Just to be precise, modulus does NOT return true and false. Given A%B it returns the remainder after dividing B into A. This happens to be equivalent to false when there is no remainder, and equivalent to true when there is a remainder.
Cheers, Rob. On Tue, 2003-08-26 at 11:11, Kae Verens wrote: > Amanda McComb wrote: > > I am having trouble finding math functions on php.net. I am also getting > > "page not found" errors when trying to search. > > > > Basically, I'm looking for a mod or division function - something I can > > use to tell me when a number is evening divisable by a certain number. > > % is the mod operator in quite a few languages, and works in PHP as well. > > if(7%4), for example, will return true (3), while (12%6) will return false > > integers only, IIRC > > Kae > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- .---------------------------------------------. | Worlds of Carnage - http://www.wocmud.org | :---------------------------------------------: | Come visit a world of myth and legend where | | fantastical creatures come to life and the | | stuff of nightmares grasp for your soul. | `---------------------------------------------' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php