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
}
?> |