Teach you how to be a good PHP player?

Source: Internet
Author: User
Keywords Web Programming PHP Tutorials
Tags code developer functions how to http network network programming not easy

PHP is an efficient network programming language, because it has the advantages of flexible writing, fast running and so on, quickly become the preferred language of web programmers. So how do you become a good PHP developer?

To become a master of PHP programming is not easy, not as many people imagine, as long as the ability to write a few simple code to solve a complex problem is the Master of PHP programming, the real PHP master still need to consider more other issues. The following three guidelines are guidelines that a mature PHP programmer should follow first in programming.

Laziness is gold.

Write Beautiful Code

Pursue the speed of the program, not the speed of programming

Laziness is gold.

Be a lazy programmer? The idea is so strange! Because the busiest person in the world is probably a computer programmer. But it is because programmers are so busy that they should learn to be lazy in programming. There are two ways to be lazy for a programmer:

First, use someone else's program code boldly, and incorporate that code into your own program or project. The second is to write some useful code to build a function library, in the future to write programs can be conveniently picked, save a lot of duplication of labor, natural can be lazy a little. Both of these lazy methods are perfect for PHP programmers.

First, PHP is a language of birth and growth in a free and open environment. Around the world, there are tens of thousands of programmers who have been struggling for the perfection of PHP and are willing to share their ingenuity and code with others. You can find a lot of good program code from PHP websites, mailing lists and newsgroups every day.

In this way, I am not encouraging you to wait for others to write code for you, but you can "stand on the shoulders of great men", fully develop "doctrine", smart application of other people's program code can save you a lot of time. Second, in PHP, you can easily build your own library of functions, which can save you a lot of trouble when you write your program later.

The following author introduces a few general functions, some of which come from some open source projects on the Internet, some are selected from the mailing list. If you can add them to your own library of functions, sooner or later you will find yourself benefiting.

1. Common Database processing functions

One of the advantages of PHP, compared to other CGI functions, is that it has a powerful database processing capability. However, in PHP, some specific functions are used for different databases, and there is a lack of common database processing functions. This greatly reduces the program code portability, which also for beginners programming friends brought a lot of inconvenience.

On the web, many programmers solve this problem by encapsulating classes. They write unified functions to handle any popular database, whether it's a popular MySQL in the Linux World or a popular SQL Server on a Windows platform.

Personally, I like to use these functions, because you can directly use some simple functions such as "Query", "Next_record", and do not need to consider the database connection, database handle these complex things, and do not need to consider what kind of database. If you need these functions, you can access the following several URLs:

http://phplib.netuse.de/

Http://phpclasses.UpperDesign.com/browse.html/package/20

http://phpdb.linuxbox.com/

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.