Login |  Register 
I thought I knew all about PHP until I found this website!

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"
   echo "Test else"
This will print Test else to the screen.

Comments to date: 20. Page 1 of 2. Average Rating:
sherzodhamzayev   9:53pm on Wednesday, April 10th, 2019 
dsf   10:53pm on Monday, January 29th, 2018 
Ashwin   3:19am on Friday, January 5th, 2018 
Fair example
ajay   4:28am on Thursday, September 22nd, 2016 
sushma gupta   11:36pm on Thursday, May 14th, 2015 
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 
brendalee.sandiego   9:26am on Wednesday, April 4th, 2012 
nice one..
frte   7:12pm on Friday, March 2nd, 2012 

Page: -1-   2   

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