Home >Backend Development >PHP Tutorial >PHP Beginner's Road 1_PHP Tutorial

PHP Beginner's Road 1_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 17:29:20913browse

b>Introduction
PHP is a server-side scripting language that is easy to learn and use. With very little programming knowledge you can use PHP to build a truly interactive WEB site. This tutorial is not intended to give you a complete understanding of the language, but to get you started developing dynamic web sites as quickly as possible. I assume you have some basic knowledge of HTML (or an HTML editor) and some programming ideas.
1. Introduction
PHP is one of the tools that allows you to generate dynamic web pages. PHP stands for: Hypertext Preprocessor (PHP: Hypertext Preprocessor). PHP is completely free. You don’t need to spend money. You can download it freely from the PHP official site (http://www.php.net). PHP complies with the GNU Public License (GPL), under which many popular software such as Linux and Emacs were born. You have unlimited access to the source code and can even add the features you need. PHP can run on most Unix platforms, GUN/Linux and Microsoft Windows platforms. Information on how to install PHP on a PC machine or Unix machine in a Windows environment can be found on the PHP official website, or you can check out the special article "Comprehensive PHP Installation Preparations" on the Tao Bar website. The installation process is simple.
If your machine solves the 2000 problem, then PHP will also not have the Y2K problem!
1.1 History
Three years ago, Rasmus Lerdorf created Personal Home Page Tools in order to create his online resume. It's a very simple language. Since then, more and more people have noticed this language and made various suggestions for its extension. Through the dedication of many people and the source-free nature of the language itself, it evolved into a feature-rich language that is still growing.
Although PHP is easy to learn, it is slower than mod_perl (the perl module implanted in the web server). There is now a new engine called Zend that is as fast as mod_perl, and PHP4 can take full advantage of this engine. Now, the official version of PHP4 has been released, and you can download it from the official website of PHP. Andy Gutmans and Zeev Suraki are Zend's primary authors. You can go to the Zend site (http://www.zend.com) to learn more.
The application of PHP has grown significantly in personal web projects. According to a Netcraft report in October 1999, there were 931,122 domains and 321,128 IP addresses utilizing PHP technology.


1.2 The advancement of PHP
There are many benefits to using PHP. Of course, the known disadvantage is that PHP has no commercial support because it is an open source project, and the resulting slow execution speed (until PHP4). But PHP's mailing list is very useful and unless you're running a very popular site like Yahoo! or Amazon.com, you won't notice any difference in PHP's speed. At least I didn’t feel it! Okay, let me take a look at the advantages of PHP:
- Learning process
I personally prefer PHP's very simple learning process. Unlike Java and Perl, you don't have to bury your head in 100-plus pages of documentation to write a decent program. As long as you understand some basic syntax and language features, you can start your PHP coding journey. If you encounter any trouble later during the coding process, you can read the relevant documents again.
The syntax of PHP is similar to C, Perl, ASP or JSP. For those who are more familiar with one of the above languages, PHP is too simple. On the contrary, if you know more about PHP, then it will be easy for you to learn several other languages.
It only takes you 30 minutes to master all the core language features of PHP. You may already know HTML very well, and you even know how to use editing and design software or manually to create a beautiful WEB site. Since PHP code can be easily added to your site, when you design and maintain your site, you can easily add PHP to make your site more dynamic.
- Database connection
PHP can be compiled with functions to connect to many databases. PHP and MySQL are an excellent combination right now. You can also write your own peripheral functions to access the database indirectly. In this way, when you change the database you use, you can easily change the coding to adapt to such changes. PHPLIB is the most commonly used series of base libraries that can provide general transaction needs.
- Scalability
As mentioned before, PHP has entered a period of rapid development. It may be difficult for a non-programmer to extend additional functionality to PHP, but it is not difficult for a PHP programmer.
- Object-oriented programming
PHP provides classes and objects. Web-based programming work requires object-oriented programming skills. PHP supports constructors, extracted classes, etc.
- Scalability
Traditionally, the interaction of web pages is achieved through CGI. The scalability of CGI programs is not ideal because it opens a separate process for each running CGI program. The solution is to compile the interpreter of the language commonly used to write CGI programs into your web server (such as mod_perl, JSP). PHP can be installed this way, although few people are willing to install it CGI this way. Embedded PHP can be more scalable.
- More features
In order to be more suitable for web programming, PHP developers have developed many peripheral popular base libraries, which contain easier-to-use layers. You can use PHP to connect to most databases including Oracle, MS-Access, and Mysql. You can draw pictures on flies, write programs to download or display e-mails. You can even complete network-related functions. Best of all, you can choose which features your PHP installation requires. To quote Nissan's Xterra, PHP can do everything you want it to do and it's omnipotent!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/531694.htmlTechArticleb>Introduction PHP is a server-side scripting language that is easy to learn and use. With very little programming knowledge you can use PHP to build a truly interactive WEB site. This tutorial is not intended to make you...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn