v1.1.2, 2008.02.01
This is by no means a complete list but it should help you convert ASP to PHP or the
other way around. PHP has many more built in commands than ASP (VBScript), so several
lines of code in ASP may convert so a single line in PHP. If you have a large application
to move from ASP to PHP, the ASP Translator is a free web
application that will save you hours of work. It converts comments, variables, if/then, loops,
and many commands from ASP to PHP, all in your web browser.
ASP (VBScript) |
PHP (v4.3+) |
General syntax |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String Functions |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Control Structures |
|
|
|
|
|
|
|
|
|
|
|
HTTP Environment |
|
|
|
|
|
|
|
|
|
|
|
|
|
File System Functions |
|
|
|
|
|
|
|
Time and Date Functions |
|
|
|
|
|
Numeric Functions |
|
|
|
|
|
|
|
Links:
13 Jun 2006 11:49am
"This is an extremely helpful cross-reference. The only other thing I think you could add would be database functions like mysql_num_rows() (PHP) and the equivalent of while looping as related to $row["colname"] vs. connection.fields("colname") Keep expanding this! It'll make it so much easier for developers like myself to continue developing solid applications. Great work."
16 Aug 2006 2:48am
"Excellent piece of info. I was searching for new line character in ASP, and found much more on this website... :)"
18 Oct 2006 5:59am
"This is a really good cross reference and it is helping me a lot. It will help all those programmers who want to learn PHP and they know ASP. Very good and thanks to the author."
09 Nov 2006 10:28pm
"This is a really good cross reference and it is helping me a lot. Its help me as a newbie in PHP. thanks to the author."
14 Dec 2006 1:37pm
"Thanks for a really great reference. No need to add this to the comments, but just to let you know that ASP *does* have a command terminator : which allows more than one command on a line"
18 Jan 2007 7:07am
"thank for these info. these will really help us in our project which will translate from PHP to ASP.NET with C#."
23 Jan 2007 7:58am
"thanks!, this saved my life!"
01 Feb 2007 6:01am
"A great list, altought a little biased towards PHP. My comments: - For new line character, vbNewLine is recommended over vbCrLf. The latter works, and its widely used, but it is obsolete and platform dependent. vbNewLine is much more elegant and platform independent. Platform independence may be not so relevant in ASP, but since it uses VBScript that can run on Mac, Palmtops, etc, vbNewLine is recommended. It is the one used on ASP .NET too. - ASP DOES have LTrim and RTrim"
01 Mar 2007 11:16pm
"great, you could add:
--------------
Session("foo") = "bar" /
session_start(); $_SESSION['foo'] = 'bar';
--------------"
30 Mar 2007 4:28am
"Hi, this is a very good cross reference"
06 Apr 2007 5:05am
"Very good idea too! Thanks a lot."
24 Apr 2007 2:12am
"hi. this is really useful for those who either know php or asp. thanks"
17 May 2007 9:22am
"i know i'm just repeating what everyone else has said before me, but this is a fantastic reference. i'm redeveloping a client's asp web app in php and you've just saved me about 3 days' worth of reading and cross referencing! this goes straight into FF bookmarks :)"
18 May 2007 5:15am
"Note that ASP commands can be terminated using a colon :, allowing multiple commands per line. seb @ sebsworld"
18 Jun 2007 5:56am
"great reference!"
29 Jun 2007 2:15am
"Excellent article, will definitely help me a lot as I am originally a PHP programmer but my work requires me to use ASP. Thanks, and please do keep expanding!"
02 Jul 2007 6:34am
"Thanks a lot - this is pretty helpful."
16 Jul 2007 6:09am
"Really nice to have this reference!! Thanks a lot!"
17 Aug 2007 7:52am
"Muito bom o guia!! Eu vou mecher justamente com as duas linguagens e as vezes fico perdido com as diferenças! Valeu!!!"
09 Sep 2007 7:32am
"exactly what i needed for my assignment! thanks for this"
03 Oct 2007 1:09pm
"FYI, statements (referred to in the reference as commands) in VB/VBA/VBScript may be separated with a statement terminator represented by the colon. For example, the following is acceptable and can be used to combine multiple statements on a single line of the source file, if desired: Dim s1: s1 = "Value1": Dim s2: s2 = "Value2" Please correct the reference with this information. Don't take my word for it. Try it with a VBScript, VBA code module, and an ASP page served up by IIS.
[Reply from Rob G]
Thanks for the information. IMHO I don't think its good programming style to have multiple statements on one line. I've noticed a number of things in ASP/VB that I feel make for sloppy programming, such as not honoring the case of variable names. I believe code is art and so I try to write code that is beautiful. =)"
05 Oct 2007 12:25am
"solved my all problems, so thanks"
09 Oct 2007 5:59pm
"Great job, I develop in both languages but this piece of info is really relevant and helpful. Thanks a lot! Asap I'll be adding something like this on my blog, loved the idea (of course I'll give you the proper credits). Keep the nice work buddy. C-ya"
25 Oct 2007 12:43pm
"I use this website almost every day @ work to convert my old ASP/VB apps over to PHP. It has helped me greatly as a quick reference. Expanding the list a little and/or perhaps allowing people to submit entries (for approval) would be nice. Keep up the good work!
[Reply from Rob G]
Submit entries here in the comments and I'll review them and add them."
02 Nov 2007 12:11am
"Hi. This is really good for those who know one language and are learning other one. Thanks design215"
03 Nov 2007 3:19pm
"Really Useful. Congratulations and Thank you very much"
14 Nov 2007 6:35am
"Saved me a bunch of time converting a stack of ASP pages into PHP. Thanks!"
19 Nov 2007 8:05am
"Hai... really it's very great stuff. Shaik Amjad"
18 Feb 2008 1:00am
"This was really useful. Exactly what i wanted. Being an ASP mind made me hard to handle PHP. This cross reference will help me to work with PHP although I am ASP minded. Got my point? I can work vice-versa without any fear of getting confused or being a mess! Again BIG thank you to the author."
07 Mar 2008 11:17pm
"really nice...... very helpful for us, thnxxxxxx a lots"