11-18-2009, 08:55 AM
|
#3 (permalink)
|
|
The Acquainted
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 137
Thanks: 3
|
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
|
|
|