Log In

  Sign In >
 
 

Other tips & tutorials Blogs

Comparing PHP to ASP - Week 3 - Number Functions

24 May 2010
tips-tutorials

Welcome to the third part of our 5 part tutorial where we will compare PHP with Classic ASP

 
 

Comparing PHP to ASP - Week 2 - String Functions

18 May 2010
tips-tutorials

Welcome to the second part of our 5 part tutorial where we will compare PHP with Classic ASP

 
 

Comparing PHP to ASP - Week 1 - The Basics

10 May 2010
tips-tutorials

Welcome to the first part of our 5 part tutorial where we will compare PHP with Classic ASP

 
 

Week 5 - JQuery and AJAX

26 Mar 2010
tips-tutorials

This week I will show you probably the main benefit of learning JQuery. AJAX (Asynchronous ...

 
 

Week 4 - Changing CSS attributes

19 Mar 2010
tips-tutorials

This week I will show you how to add CSS styles to elements on a page of your website.

 
 

Categories

Archive

2010
2 3 4 5 6 7 8 9 10 11 12

 

 

Comparing PHP to ASP - Week 4 - Looping

2 Jun 2010 - tips-tutorials

Comparing PHP to ASP - Week 4 - Looping

Welcome to the fourth part of our 5 part tutorial where we will compare PHP with Classic ASP.

The objective of these tutorials is to show you how to do some basic programming in PHP and compare it to how you would do it in Classic ASP using VB Script.

This five part tutorial will be split into five sections:

Looping is an important part of any development language. For this tutorial we will look at some of the most common ones used as a developer.

For Loops in PHP

The 'For' loop is used when you know in advance how any items you want to loop through.

For Loops in Classic ASP

Both of these examples would output a sequence of numbers between 1 and 5.

For Each Loops in PHP

The 'For Each' loop is used to loop through an array.

For Each Loops in Classic ASP

Each of these examples will write all three items of the array to the browser.

If Else Statements in PHP

If statements are used if you want some code to be executed if a certain condition is true. If the condition if false, the else part of the statement will be executed.

<

If Else Statements in Classic ASP

Each of these examples would output "Your variable is greater than 10" because the variable is set to 11 in each example.

I hope you have enjoyed part 4 of our 5 part tutorial. Look out for part 5 on sessions and cookies coming soon.

Simon Lait
Website Developer, Candeo Media

SHARE THIS

Your Comments

There are no comments for this post yet.

Comment on this Post

 
 
 
verification image

Please enter the verification code that appears in the box above into the box below to proceed:

 
 
 
 
 
 
Web Design & Development, Graphic Design, Email Newsletter Marketing, Search Engine Optimisation, Web Application Development, Social Networking and more...
 
 
Close

Sign up to our newsletter