Home > Article > Backend Development > What is the syntax difference between php and asp
Let me introduce to you some syntax differences between php and asp:
1. Delimiter
PHP The delimiter is 659439fd8b7e1be3869d8a0b0407d72d
;The delimiter of ASP is 72637aecae1027e7d023ac098a170986
2. Case sensitivity
PHP is size sensitive Write; ASP is not case sensitive.
3. Comments
PHP has two kinds of comments: single-line comments (//) and multi-line comments (/**/); ASP uses ' as comment symbol .
4. Declaration of variables
PHP uses $ to declare variables, for example: $a
; ASP declares them directly, for example: a .
5, if statement
PHP
if (条件){ 语句 } else{ 语句 }
ASP
If 条件 then 语句 Else 语句 End if
6, For statement
PHP
for ($i=m;$i<=n;$i++){ 语句 }
ASP
For i=m to n 语句 next
7. While statement
PHP
while (条件){ 语句 }
ASP
Do while 条件 语句 loop
8. Import statement
PHP
require(“”) require_once(“”) include(“”)
ASP
<!--#include?file=””-->
9. Jump statement
PHP
Header(“location:a.php”)
ASP
Response.redirect“a.asp”
10. Get the data submitted by the form
PHP
$_POST[“a”] $_GET[“a”]//url数据
ASP
Request.form(“a”) Request.querystring(“a”)//url数据
11, global variable SESSION
PHP
$_SESSION[“a”]
ASP
Session(“a”)
12, class
PHP supports classes, ASP does not support classes
The above is the detailed content of What is the syntax difference between php and asp. For more information, please follow other related articles on the PHP Chinese website!