View Single Post
Old 11-18-2009, 08:55 AM   #3 (permalink)
maeltar
The Acquainted
 
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 137
Thanks: 3
maeltar is on a distinguished road
Default

I may be getting ahead fo you slighty here but the above code would be considered "dirty" as it would interupt code flow..

The following code does exactly the same tests on vars $a and $b then echo's the message to screen..

Code:
<?php

// Set vars
$a = 10;
$b = 20;

// Check if $a is less than $b
if ($a < $b)
        {
        // yes it is
        echo "TRUE\n";
        }
        else
        {
         // no it isn't
         echo "FALSE  (or NULL)\n";
         }

?>

Always always always, comment your code, makes it much easier to understand, and is a good habbit to get into right from the start.
__________________
Thanks... Simon

Sex, Drugs & Linux Rules
Send a message via MSN to maeltar
maeltar is offline  
Reply With Quote