Novice: What is PHP? Why do you choose PHP for Web development?

Source: Internet
Author: User
Tags execution install php mysql php and php and mysql php code what php zend

PHP Tutorial PHP Beginner's Tutorial What is PHP why choose PHP

  One, what is PHP? The concept and introduction of PHP

PHP is a server-side scripting language that is easy to learn and use. With minimal programming knowledge you can use PHP to create a truly interactive web site. This tutorial does not want you to fully understand the language, only to enable you to join the development of dynamic Web sites as soon as possible. I assume you have some basic knowledge of HTML (or HTML editors) and some programming ideas. Web page Teaching Network webjx.com

1. Introduction

PHP is one of the tools that will allow you to generate dynamic Web pages. PHP representative: Hypertext Preprocessor (Php:hypertext preprocessor). PHP is completely free, and you can download it free from the official PHP site (http://www.php.net) without spending money. PHP complies with the GNU Public License (GPL), under which many popular software such as Linux and Emacs are born. You can gain unlimited access to the source code, and even add the features you need to yourself. PHP can be run on most Unix platforms, Gun/linux and Microsoft Windows platforms. How to install PHP data on a PC or UNIX machine in a Windows environment can be found on the PHP website, and you can also check out the "PHP Installation all Ready" feature article of the Web page Pottery bar. The installation process is simple.

If your machine solves 2000 problems, then PHP has no bug problem! Web Teaching Network

PHP's application has grown significantly in personal web projects. According to Netcraft's October 1999 report, there are 931,122 domains and 321,128 IP addresses using PHP technology. Webjx.com

  1.2 PHP's Advanced Place

There are many benefits to applying PHP. Of course the known disadvantage is that PHP, because it is an Open-source project, has little business support, and the resulting slow execution rate (until PHP4). But the PHP mailing list is very useful and unless you're running a very popular site like Yahoo! or Amazon.com, you won't be able to feel the speed of PHP different from any other. At least I don't feel it! Well, let's see what PHP has to do: Web teaching

-Learning process

I personally prefer PHP's very simple learning process. Unlike Java and Perl, you don't have to bury your head in more than 100 pages of documents and work hard to write a decent program. Just learn some basic syntax and language features and you can start your PHP coding trip. After that, if you have any trouble with the coding process, you can also read the relevant documents.


PHP syntax is similar to c,perl,asp or JSP. For those who are familiar with one of the above languages, PHP is too simple. On the contrary, if you know more about PHP, you will be easy to learn about several other languages. Web page Teaching Network webjx.com


You'll only need 30 minutes to master all of the core language features of PHP, you may already know the HTML very well, even if you've already learned how to use editing software or hand-crafted Web sites. Because the PHP code can be easily added to your site, you can design and maintain the site at the same time, you will be very easy to join PHP to make your site more dynamic characteristics. String 5

  -Database connection

PHP can be compiled into functions that have connections to many databases. PHP and MySQL are now the perfect combination. You can also write your own peripheral functions to access the database indirectly. This way you can easily change the encoding to accommodate this change when you replace the database you are using. Phplib is the most common set of base libraries that can provide general transaction needs. String 9

  - Scalable Teaching Network webjx.com

As I said before, PHP has entered a period of rapid development. It may be difficult for a programmer to extend additional functionality for PHP, but it is not difficult for a PHP programmer.

  -Object Oriented Programming

PHP provides classes and objects. Web-based programming is a great need for object-oriented programming capabilities. PHP supports constructors, extraction classes, and so on. Teaching Network webjx.com

  -Scalability

Traditionally, the interaction of Web pages is achieved through CGI. The CGI program's scalability is not ideal because it runs a separate process for every CGI program that is running. The solution is to compile the interpreter for the language that is often used to write CGI programs into your Web server (such as mod_perl,jsp). PHP can be installed in this way, although few people would like to install it in a CGI way. Embedded PHP can have a higher scalability. Web Teaching Network

  -More Features

In order to be more suitable for web programming, PHP developers have developed many of the popular base libraries around the periphery, which contain more easily available layers. You can use PHP to connect most databases, including Oracle,ms-access,mysql. You can paint on flies, write programs to download or display e-mail. You can even complete network-related functions. Best of all, you can choose which features you need for your PHP installation version. The quote from Nissan's Xterra is that PHP can do what you want it to do and do everything!

  Why should you choose PHP for Web development?

  2. Competitor: asp,mod_perl,jsp webjx.com

There are a lot of techniques for implementing interactive dynamic Web pages, where CGI is also known as the Universal Gateway Interface (Common Gateway Interface), which is the standard programming interface between external programs and Web servers, but there are so many drawbacks to CGI programs While Perl solves the problem in CGI and is used to drive complex web technologies, Microsoft's ASP (Active Server Pages) appears to be easy to use, Easy to write programs and strong backing of Microsoft software makes the ASP suddenly become a professional programmer and the darling of the professional programmers; cold fusion of Middle Ware and Allaire is another solution, and cold Fusion has a proven reliable search engine components; JSP is the new generation of web development language launched by Sun and so on. With so many dynamic Web technologies, you might ask: "Why do I have to choose PHP?" ”

  Before answering this question, let's take a look at the pros and cons of asp,php and JSP.

  2.1 About ASP Web page teaching Network webjx.com

ASP because of its simple functions and practical aspects by the broad masses of friends like, coupled with the strong support of MS, can be said to be the most popular language at the moment, he uses MS COM + technology, can almost achieve in C/s can achieve all the functions, can be said to be quite competitive. ASP's code implementation is also very simple, MS provides InterDev on the basis of RAD, so that the development of ASP over the night across the river. But his disadvantage is that, because of MS's long high-handed style, he can only run on the mobile suit platform, so it is difficult to easily accept the key applications.

  2.2 About JSP

JSP is the Sun introduced a new generation of site development language, he completely solved the current asp,php a common problem-script-level execution (now PHP4 also has the support of Zend, implementation of the compile run). With its own extraordinary Java attainments, Sun has a new fruit in addition to Java applications and Java applets, the Jsp--java Server Page. JSP can complete the powerful site program with the support of Serverlet and JavaBean. Web page Teaching Network webjx.com

As far as I know, JSP is based on Java, so Java programmers can easily start coding. ASP is just a generic engine with the ability to support multiple languages, but the default and most commonly used is VBScript. Mod_perl is as powerful as Perl, just a little faster. Web page Teaching Network webjx.com

For ASP, JSP, PHP and so on, in the end what kind of language is better? Different people have different views. But one thing we have to be clear about is whether you know how expensive it will be to buy them, as well as how expensive and powerful the hardware is, for ASP, JSP, and so on. If you have any neutral points of view (such as not affected by the million dollars of Sun and Microsoft), please let me know. Web page Teaching Network webjx.com

2.3 About PHP teaching web

PHP is the GNU style of Linux, with the help of open source, so that he quickly become the world's most widely used site production language. In the form of C + +, referencing the concept of the class, making the code repeatable application of the exception is simple. Plus he and Linux,apache and MySQL close cooperation, the key application is no problem (famous Sina is the use of PHP). At the same time, the PHP fourth generation Zend (PHP4) The core engine of the official version has also been released, the entire program's core has been greatly improved, so that the PHP program to perform faster. The efficiency of PHP after optimization has been better than traditional CGI or ASP programs. And because PHP is free, anyone can access the PHP Web site and download the full source code. More importantly: the code written in PHP will execute faster, can achieve the same function of the PHP code, without change can be on different Web servers, different operating systems run. With this, you have enough reason to choose PHP.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.