MathCurvesSurfacesWallpaper GroupsGallerySoftwarePOV-Ray
ProgramingLinuxPerl PythonHTMLCSSJavaScriptPHPJavaEmacsUnicode ♥
Web Hosting by 1&1

PHP: “if” statement

Xah Lee,

Example of “if” and “if else” statement:

<?php
if (5 > 4) {echo "yay!";}
if (3 > 4) {echo "yay!";} else {echo "Nooo!";}
?>

Example of “elseif” statement:

<?php
$a=3; $b=4;
if ($a > $b) {
    echo "O No!";
} elseif ($a == $b) {
    echo "O Yes";
} else {
    echo "Problem!";
}
?>

control-structures

blog comments powered by Disqus
2007-11