Login |  Register 
After taking your course, my knowledge of PHP has ballooned!
Rob
 

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: 19. Page 1 of 2. Average Rating:
dsf   10:53pm on Monday, January 29th, 2018 
fgfgf
Ashwin   3:19am on Friday, January 5th, 2018 
Fair example
ajay   4:28am on Thursday, September 22nd, 2016 
bjhk
sushma gupta   11:36pm on Thursday, May 14th, 2015 
nice
tearshe   10:26pm on Monday, April 27th, 2015 
Well Played
sam   2:28am on Thursday, July 17th, 2014 
good one
shreeram sharma   11:47am on Saturday, June 30th, 2012 
nice
brendalee.sandiego   9:26am on Wednesday, April 4th, 2012 
nice one..
frte   7:12pm on Friday, March 2nd, 2012 
dfre
ukreddys   9:58am on Sunday, January 1st, 2012 
very worst


Page: -1-   2   

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