WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : How to judge if an integer is odd or is even in Php3?
Categories : Math., PHP, Algorithms Update Picture
Sandino Araico
Date : May 29th 1998
Grade : 1 of 5 (graded 1 times)
Viewed : 8050
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Sandino Araico
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?
        if (empty($integerNo)){
?>
        <p>ZERO</p>
<?
        }else{
                if($integerNo % 2){
?>
        <p>ODD</p>
<?
                }else{
?>
        <p>EVEN</p>
<?
                }
        }
?>



Show the steps for converting a number from a given base to base 10. Shows the steps involved in converting a number from a given base to base 10.
Categories : PHP, Math., Algorithms
Library of math functions to expand the functionality of PHP3. Version 1.2.1 fixes a major problem with the gcd function.
Categories : Algorithms, PHP, Math.
Prime number finder (Sieve of Erastothenes)
Categories : PHP, Algorithms, Math.
Diffusion-Limited Aggregation visualization
Categories : PHP, Graphics, Algorithms, Math.
Reverse a given number
Categories : PHP, Beginner Guides, Algorithms, Math.
Find the day of the week for any given year/month/day.
Categories : PHP, Date Time, Data Validation, Algorithms, Beginner Guides
Temperature Conversion
Categories : PHP, Math., Beginner Guides
Timer - a class that uses microtime() to provide easy calculation of elapsed times
Categories : Algorithms, PHP, PHP Classes
IPhider Obscure Any URL Anonymity connection lores obfuscation corporate survival.
Categories : PHP, Algorithms, Security, URLs
minus - subtract arrays. Send two arrays and get an array with the operation A-B, elements on A that are not included on B.
Categories : PHP, Arrays, Algorithms
Recursive function to move files on a filesystem. It can be minor changed in order to copy recursively.
Categories : PHP, Filesystem, Algorithms
Calculator for Baroque Violin strings
Categories : Math., PHP, Strings
quick sort for associative arrays
Categories : Algorithms, Arrays, PHP
Browse a MySQL database & draw a tree view & load final items into a template page.
Categories : MySQL, Complete Programs, Algorithms, PHP, Databases
Output database records in multiple table columns. multiple, table, columns, output, format, query output, html table, php
Categories : General SQL, Algorithms, PHP, MySQL
 Mahendra Kalkura wrote : 816
hey buddy
look at the code below
this thing works fine for me
test it out and tell me if it works for you ok

<?php

$integer
=676;

if (empty(
$integer))
    {
    print(
"ZERO");
    }
else
    {
    if((
$integer 2)==1)
        {
        print(
"ODD");
        }
    else
        {
    print(
"EVEN");
        }
    }

?>
 
 Alix Axel wrote :1794
Well, 0 (zero) is a even number you could simply write a function like this:

<?php

function Even($number)
{
    return 
$number == 0;
}

// or:

function Odd($number)
{
    return 
$number == 1;
}

?>