Quick Search:
 
 PHP Code: Is Number Even? Jump to:  
Category: >> PHP Code >> Is Number Even?  

<< lastnext >>

Snippet Name: Is Number Even?

Description: If the variable contains an odd number, don't execute the code.
If the variable contains an even number, execute the code.

Comment: (none)

Language: PHP
Highlight Mode: PHP
Last Modified: February 27th, 2009

<?PHP
 
IF ($var % 2){
     // odd number, run this code
}ELSE{
     // even number, run this code
}
 
?>


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org