PHP and MySQL programming (version 3rd) -- 1.2 general language features

Source: Internet
Author: User

1.2 general language features

Each user may have their own specific reasons when using PHP to implement key business applications, but some people think that these reasons can be divided into four main categories: practicality, powerful functionality, selectivity, and cost.

 

1.2.1 Practicality

Since then, PHP has been created for the purpose of practicality. After all, the initial intention of Lerdorf was not to design a brand new language, but to solve a problem with no ready-made solutions. In addition, the early development of PHP did not explicitly wish to improve the language itself, but only needed to add features to users. The result is that a minimalist language is established, which not only has low requirements for users, but also has low syntax requirements for languages. For beginners, a useful PHP script may only contain one line of code. Unlike C, it does not need to be imported into the database. For example, the following code is a complete PHP script to output the current date in a format similar to September 23,200 7:

If you don't understand it, you don't have to worry about it. The subsequent sections will introduce the PHP syntax in detail. Now you only need to know what to do.

The PHP language emphasizes closeness, which is also reflected in its ability to nest functions. For example, you can call a function in a specific order in a line of code to make a series of modifications to a value. In the following example, a string consisting of five letters or numbers is generated, such as a3jh8:

PHP is a loose language, which means you do not need to explicitly create variables, assign types, or revoke variables. Of course, these operations are not absolutely prohibited. PHP is transparent in dealing with these situations. When using variables in the script, PHP dynamically creates variables and automatically assigns the types of variables using the optimal speculative rules. For example, PHP considers the following statements to be completely legal:

PHP automatically revokes the variable at the end of the script and returns the resource to the system. From these aspects, because PHP handles many management issues in programming internally, developers can focus on the ultimate goal of developing a practical application.

 

1.2.2 Powerful functions

Currently, PHP has 180 available libraries and more than 1000 functions. Maybe you know that PHP can access the database, process form information, and dynamically create pages, but you may not know that PHP has the following features.

Q: Create and process Macromedia Flash, images, and PDF files.

Q. Compare the password with the dictionary data and the easy-to-crack mode to evaluate the testability of the password.

Q uses POSIX and Perl-based Regular Expression Libraries to parse the most complex strings.

Q: The user identity is verified by storing the logon creden。 in plain text files, databases, or Microsoft Active directories.

Q uses multiple protocols for communication, including LDAP, IMAP, POP3, NNTP, and DNS.

Q is integrated with a large number of credit card processing solutions.

This has not taken PHP extensions into account with the features in the application library (PEAR). It has collected hundreds of open-source packages that are easy to install and can be further expanded in any way. You can learn from Chapter 1

Related Article

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.