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.
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:
- Part 1 - The Basics
- Part 2 - String Functions
- Part 3 - Number Functions
- Part 4 - Looping
- Part 5 - Sessions and Cookies
String Length in PHP
String Length in Classic ASP
Both of these examples would output the value 11.
Make a String Uppercase in PHP
Make a String Uppercase in Classic ASP
Both of these examples would output the value HELLO WORLD.
Make a String Lowercase in PHP
Make a String Lowercase in Classic ASP
Both of these examples would output the value hello world.
Return Part of a String in PHP
The function we will be using for this is substr(string,start,length)
The substr() function take three parameters:
string - the string used to return part of
start - the start position to return part of
length - the number of characters to return after the start position