Virtual Brain Online Logo

Bookmark: Root \ PHP \ Test for Even or Odd numbers

Test for Even or Odd numbers


Last Updated: 2006-07-18

if ($test % 2 == 0) {
//Even
}
else{
//Odd
}

Source: php.net
Originally Posted by Skylinux @ 2006-07-18 00:24:56

 

Title:
Posted By: Matt On: 2010-02-21 04:32
Running: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8
You rock! Works like a charm. Thanks!

 

Add Your Comment:

Note: All posts require administrator approval. Please allow 24 hours for message approval.

Name:
E-Mail:
Title
Plain text only, less then 65 000 characters.

How many full bottles of water do you have when you drink one of your two bottles of water?

Please answer the question above and type the answer into the text box below.