PHP enterprise development strategy-for beginners

Source: Internet
Author: User
Tags array definition php database
In almost all articles, books, or network logs I have read, "PHP cannot be used for enterprise development" (or similar languages) all of these so-called "brick houses" are put at your lips. This is nonsense! Shameless! Only those who just say no to practice have such a mentality! PHP is not only a Web developer, but also good at enterprise development. I,

In almost all articles, books, or network logs I have read, "PHP cannot be used for enterprise development" (or similar languages) all of these so-called "brick houses" are put at your lips. This is nonsense! Shameless! Only those who just say no to practice have such a mentality! PHP is not only a Web developer, but also good at enterprise development. I,


In almost all articles, books, or network logs I have read, "PHP cannot be used for enterprise development" (or similar languages) is put to the lips of so-called "brick houses. This is nonsense! Shameless! Only those who just say no to practice have such a mentality!

PHP is not only a Web developer, but also good at enterprise development.

I. Learning Objectives

Learning PHP is not only a language, but also a programming idea, a development mode. If you have mastered the PHP language, it can make your future career more smooth.

In many enterprise development platforms (Java ,. NET) today, the PHP language, with its concise syntax and support from many vendors, has become a rising star in enterprise platform development. Mastering PHP is equivalent to mastering the products provided by many vendors, this provides more options for your future career development.

In addition, due to the complete system of PHP, PHP developers can easily transfer it to mobile phone development ,. NET, Java, and other languages can also be quickly entered into the project management and project analysis ranks.

2. Enterprise Development Platform

The legend shows the components of the Enterprise Development Platform and its correspondence with PHP Technology.

During Enterprise Development, we can find that all development operations are completed between the program and the database through middleware. Therefore, in the entire enterprise development environment, database is a very important operation. To make database operations more reasonable, we must have strong program logic and good system design capabilities.

Iii. Relationship between PHP and PHP EE

PHP is actually a development technology of an enterprise platform. It involves a lot of technologies. enterprise technologies developed using PHP can be called php ee. Therefore, every beginner must first understand the relationship between php se and php ee ,.

We can clearly find that if you want to develop php ee, php se is a necessary component, which is why before learning php ee, beginners must have a solid foundation for php se.

Iv. core technologies of PHP SE

There are four core components in php se, which are directly related to future php ee development.

1. process-oriented/object-oriented

PHP supports two development modes: process-oriented development and object-oriented development. Here we will mainly talk about the latter, it mainly requires beginners to establish an object-oriented concept and use these concepts flexibly for program analysis. It can be said that the core of the entire php se is object-oriented development, there are many concepts involved in it, but all concepts eventually serve interfaces and abstract classes, and all the design patterns involved in PHP development, in fact, it is also for applications of interfaces and abstract classes. Of course, it is not limited to one method. In many cases, process orientation is more efficient and fast.

PHP is not an object-oriented proprietary language, and C ++ is also not. It only adds object-oriented support based on the C language, and PHP is the same. Compared with Java, this type of language should be classified as a hybrid language. This means that PHP can select the corresponding development mode based on the actual needs of the project or product.

2. class set framework and standard function library

Most Beginners should have heard or learned about data structures. Although they have been learning data structures and algorithms since college, in fact, after learning, there are not many people who can write data structures. Most of the data structures are explained in C language, and the class set framework is equivalent to the data structure implemented by PHP, including trees, linked lists, queues, etc. If only the readers who develop application layers do not need to have a deep understanding of their internal operations, but they must have a clear understanding of their core interfaces and various operation classes.

The most frequently used data structures in PHP are just a few (strings, arrays, and composite structures composed of basic data structures ).

PHP provides a large number of function libraries, which can be selected based on actual needs. Of course, you can also select some common third-party class libraries, it is used to conveniently implement the special functions that cannot be implemented by the standard function library and the class set framework.

3. IO operations

For most of the scholars, IO operations may be the easiest, and input and output operations in PHP are easier and more convenient than other languages. Of course, it also provides the advantages of other languages and object-oriented methods.

4. PHP database operations

PHP provides a large number of database operations technologies, standard MySQL extensions, and object-oriented MySQLi extensions. It also provides the database abstraction layer technology, it provides a large number of Operation interfaces. Each database manufacturer implements their own database operations based on these interfaces. From the perspective of object-oriented design, users do not need to consider how their interfaces are implemented, but more is concerned about how to use these interfaces. In addition, from the current project development, beginners can clearly find that most of the development is based on database development.

Although the core of php se is the above four, for program development, every beginner should establish some basic program ideas. For Beginners, the basic knowledge points of php se should be fixed, basic cyclic operations should be clear, such as printing positive triangles, 9-9 multiplication tables, and bubble algorithms.

In addition, there is no shortcut to the development of learning programs. Every ordinary person must be familiar with the code repeatedly to understand the code, just like practicing martial arts, in this way, you can send and receive your actions freely and use them flexibly. The code is naturally written only when you are familiar with it. Therefore, you can only master the programming language with hard work. In the world, there may be program talents, however, we admit that, like most people, we are ordinary people who come out every step at a time.

V. Enterprise platform development architecture

The PHP enterprise development platform has three development architectures: standard development architecture, open-source development architecture, and hybrid development architecture.

  • Standard development architecture: the standard php ee development technology is used, and HTML/XHTML and PHP are used for development. The standard architecture can be independently developed using PHP, HTML, and XHTML technologies, or distributed development can be completed through Web Service and XML_RPC. However, the cost of this development architecture is high, therefore, open-source framework technologies are also commonly used in current development.
  • Open-source development architecture: We often mention ZF (zendframework), CP (cakephp), CI (codeigniter) and other framework technologies. These are just derivative products of standard development technology.
  • Hybrid development architecture: Because PHP is easier to process Web processes than other languages, you can see it by comparing the form processing. Therefore, it is often used as a web layer, the application is developed in other languages (such as Java or.. net components), which are frequently encountered in some large projects. It reduces the development difficulty and improves the development efficiency. Of course, the requirements for personnel levels will also increase.

6. Learning steps

Sometimes we often see many beginners asking: "I have only learned C language. Can I learn PHP ?"

Here, people who have learned the C language will find that learning PHP is very simple, because their syntax is basically the same, so the basics are getting started very quickly. In fact, if you have read other language books, you should find that these programming languages are the same. The core content is keywords, basic control, arrays, methods (functions), and function libraries; find different methods based on different platforms, so do not be confused by different languages or be difficult, because when you have completely learned a language, all others have learned.

Follow these steps to learn PHP:

1) key points: fully understand every knowledge point and be proficient in coding

  • Main functions, features, and development environment of PHP
  • The basic structure and Keywords of the program.
  • Various cyclic control and operators.
  • The definition of a string, the common functions of a string, and the usage of a regular expression are actually regular expressions.
  • Array definition, two basic types of arrays, traversing arrays, merging arrays, conversion of strings and arrays, and basic operations of arrays.
  • Class and object, class definition structure, constructor, private, static, this,:, reference transfer, internal class, this part of the content must master the development method of simple class.
  • Class extension, super, final, abstract class, interface, polymorphism, object cloning, object detection, and actual analysis.
  • Exception cause, standard Exception Handling statement format, try, throw, catch

1. Common PHP function libraries

When learning, do not spend too much energy remembering how to use functions. The key is to learn how to query documents. PHP provides too many functions, and everyone cannot write them down, you can probably remember what functions are used. Then you can use the document to query the specific usage. No one can memorize all the function libraries. You only need to flexibly master the commonly used functions. For example, date and time processing functions, regular expression functions, string processing functions, array processing functions, and image processing functions.

Personal suggestion: You should review the functions related to the data structure.

2. Functions and usage of PHP class sets

In addition to some standard function libraries, PHP also provides some standard class set frameworks (also called the standard PHP library). It improves the PHP language in five key aspects, including: iterator, exception, array overload, XML, and file and data processing capabilities. It also provides other useful items, such as observer mode, counting function, auxiliary function for object identifier, and iterator processing function. In addition, it provides advanced functions for automatically loading classes and interfaces.

However, this part does not take too much time to learn, because it is not used much in actual development.

Personal suggestion: It is negligible. It is not too late to study again when learning OO.

3. php io object-oriented and process-oriented embodiment, file processing, Stream Classes, Serializable, etc.

4. MySQL, SQL commands, Statement, PreparedStatement, ResultSet, and transaction processing.

Personal suggestion: master the query statements. And CURD statements.

2) understand and grasp the content: master the basic effect of its operation, and the specific code does not need to be fully and flexibly mastered.

Form Processing: Running forms, implementation methods, and differences

Session processing: two mechanisms and implementation methods

XML Processing: data exchange and read/write

PHP input/output buffer: read and write operations

PHP reflection mechanism: the key part is how to obtain the Class Object and instantiate the object.

PHP development tools: development tools themselves are not the focus. Beginners must remember that as long as the program is written, development tools will naturally make it.

After learning php se, I suggest that beginners learn about the database first. From the perspective of software development in China, Oracle, MySQL, and ms SQL Server are mostly used, however, I personally think that learning MySQL is better, and beginners must remember that, in PHP development, if MySQL is used, the performance is the highest, so: here I recommend MySQL databases, followed by ms SQL Server. Many people now recommend Oracle, not to say that Oracle is not good, because the achievement rate of Oracle is too low, and the investment ratio is not the best. In addition, beginners must also be aware that we are program developers and database management is another discipline. When learning databases, we should focus more on writing SQL statements.

In the end, I hope every beginner can learn something, because from my personal learning, as long as I have learned PHP, then. NET or some other static languages can be easily learned. If you still like window development, you can also learn php gtk development. In fact, it is also very easy, from the accumulation of 1.1 million drops, let's start working hard now. Our mingjia online will provide you with the best materials and the best help for your learning.


In fact, the learning steps described above are often encountered in training in other languages or related books. They actually use the introduction mode of syntax + case + API + so-called engineering cases. This mode is increasingly not suitable for the current software development requirements. I will discuss this topic later, here we will first bury a mine.

I have talked so much about it. I hope it will be helpful to anyone who has learned PHP. I also hope you can give me some valuable suggestions on my article. It is best to leave a comment!

The above article was previously published in the magazine of LAMP brothers and has been edited!

For more information, see my blog:

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: 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.