There are seven reasons to say that PHP is better than asp:
1, speed, speed, speed
ASP is built on the COM architecture. When you write ASP scripts in VBScript, you actually use COM objects, and when you send a message to a user's browser, it uses the write method of the response object, which uses other COM objects when it accesses the database and file system. The use of these COM objects slows down the operation.
In the PHP code, all the work is running in the PHP memory space, that is, PHP is not based on COM objects, so he runs faster.
Here are the execution time statistics for the 40 times we ran a query in MSSQL7:
PHP Querying MSSQL7 Time (sec)
With MSSQL extension 01.88
Using ODBC extension 09.54
With ODBC via COM (ADO) 17.28
With OLE DB via COM 06.19
When we use PHP.ODBC, it takes 9.54 seconds to access the database, and a COM interface to connect to the database is 80% higher than the time spent in PHP.
OLE DB is Microsoft's high-speed access to the database technology, he is faster than ODBC. But when the efficiency of our PHP and OLE DB experiments, the result is that PHP's overall performance is 200% higher than OLE DB, so a conclusion, if not using COM can achieve faster execution speed.
Of course, PHP execution speed is not the fastest, but we are just beginning to start, we will gradually improve him, and PHP is an open source programming language, the world many programmers are constantly improving his technology, I believe he will be more than open source code system to achieve higher execution speed.
2. Advanced Memory Management
Under the IIS4, An ASP script header.asp, if 20 pages contain, then run, in memory will retain these 20 header.asp compiled copy, IIS5 solve this problem, but only windows2000 support IIS5, because of this IIS5 not backward-compatible reasons, many The server still has to use low-level memory management under IIS4.
In PHP, there is no such problem, and only one of the include files will be invoked when require.
3, no worries
When you buy an ASP, if you need encryption technology, you have to buy aspencrypt, when you need email management, you have to buy serverobjets Qmail, when you need file upload, you also buy artisans sa-fileup.
4, MySQL makes PHP more exciting
The combination of PHP and MySQL is both simple and exciting. PHP has a lot of tools to manage and maintain MySQL, and the support for MYSQK is the most comprehensive. Many useful functions, such as mysql_insert_id and Mysql_affected_rows, are not available in other databases.
Both ASP and PHP are ideal solutions for midsize sites, but the tight combination of PHP and MySQL makes PHP even more advantageous.
MySQL is wasted faster than Microsoft Access, and MSSQL and Oracle are faster than MySQL, but at a higher cost.
5, Java and C + + into the style
This advantage is only a view.
I know you wouldn't believe it. A Visual Basic programmer will switch to PHP because PHP has Java and C + + programming styles, but you will believe that there are many people who prefer Java and C + +, and PHP is a language that is easier to learn with the programming style of both languages.
PHP supports structured programming, in VB because of his inherited use of classes or less. PHP's inheritance, like Java and C + +, makes a large program full of class shadows everywhere.
6, the handling of the bug
Have you ever asked Microsoft to modify some of your ASP's bugs? If you're not a Boeing-like organization, you can't get a quick and proper fix, and if you stop working with bugs, you won't be able to continue your work if the bug doesn't change.
PHP, when you find bugs, you can modify him, if you do not have the expert level, you can ask the expert to modify, and your changes will be open Code organization acceptance and recognition.
7, transplantation of
Microsoft frequently modifies ASP, the next version is called Asp+, and now the test is started. I am sure they will revise many of the problems I have mentioned. But there is no doubt that Microsoft will limit you to their product range.