Login |  Register 
Your open source Rocks PHP Library has really made developing PHP easier!
Alan
 

Basic control statements

The most basic control statement is the IF statement which if some condition is true will execute a section of code. So
if ($count == 10)
{
   echo "Test complete"
}
This will print "Test complete" on the screen, when the variable count reaches 10. The IF statement can be extended by using a ELSE statment. The code in the else block will only execute when the IF statement is false. So..
$count = 5;
if ($count == 10)
{
   echo "Test complete"
}
else
{
   echo "Test else"
}
This will print Test else to the screen.

Comments to date: 10. Page 1 of 1. Average Rating:
ukreddys   9:58am on Sunday, January 1st, 2012 
very worst
Rich1980   5:22pm on Friday, July 29th, 2011 
well explained!!
Sagi   5:54pm on Friday, July 15th, 2011 
If you want to get read, this is how you souhld write.
mukesh   8:50am on Friday, July 1st, 2011
where BASIC OPERANDS AND OPERATORS are perfomaed??
lala   8:45pm on Tuesday, May 3rd, 2011 
hello5
katieE   8:44pm on Tuesday, May 3rd, 2011 
hello4
katieS   8:43pm on Tuesday, May 3rd, 2011 
hello3
Katie   8:43pm on Tuesday, May 3rd, 2011 
hello2
katie   8:42pm on Tuesday, May 3rd, 2011 
hello1
Suraj   1:02pm on Thursday, April 1st, 2010 
MY BOOK IS PHP ROCKS

security image
Written by Dominic Skinner
Last Updated: 2011-10-25 16:00:38