With its easy-to-learn characteristics and the advantages of agile development, PHP has slowly grown from an almost unknown open source project to the preferred dynamic web design tool for technicians. Compared with other languages, PHP performs better. Faster, easier to learn. Despite this, when we face a new technology that we are unfamiliar with, we still feel at a loss. We don’t know where to start, and we always seem to be unable to find a clear context. In addition, the biggest obstacle is that the learning process is boring and boring, resulting in loss of interest in learning. However, if you can master a learning method that suits you, you can get twice the result with half the effort. Based on my many years of PHP teaching experience and many successful cases of talent training, the learning methods listed by me are more or less useful for reference. Of course, no matter how scientific the learning method is, it can only help you avoid detours, but it cannot be mastered overnight. It still requires long-term practice!
1. Determine the learning goals
There is a reason for learning PHP. What makes you choose to learn PHP? Is it a hobby? Is it to find a job? Or is it a development need at work? Or recommended by others? etc. Of course, no matter what your reasons are, since you choose to learn PHP, you must have firm belief. You cannot learn a language on a whim for a while, then switch immediately when you hear someone say how good a certain language is, or learn multiple languages at the same time. Only by concentrating on a course and working hard can you become an "expert", and by persevering can you become interested. After all, interest is the best teacher!
2. PHP learning roadmap
When they first start learning PHP, most novices will be a little confused. They don’t know where to start, don’t understand the order of learning, and can’t find the focus of learning. For example, some novices heard that learning PHP requires setting up a running environment first, so they set it up based on online information. There is a lot of information about this on the Internet, almost all of which are professional environments used in real projects. All provided are source code package installation methods under Linux, which are quite complicated. If you customize the installation according to the project function, it may cost one or two dollars. Days, some newbies need to spend a month or two to get a rough idea, which is why many novices choose to give up from the beginning. If someone teaches you an integrated installation environment for learning, it may only take you 5 minutes to complete it. There are also novices who have been learning for a long time, but they just don’t know how to write projects. They have to learn the basic parts over and over again, but they just stagnate. There are also some novices who can't find the key points and learn a lot of content, but in the end they don't actually use it much. Most likely they will never use it in their lifetime, which wastes a lot of time. So when a novice starts learning, it is like walking deep into the mountains. You need someone to guide you and find the right direction before you can move forward. Figure 1-15 is a learning route diagram for PHP novices.
According to the guidelines in the PHP learning roadmap 1-15, the process of learning PHP can be divided into 4 stages. Go step by step, set a learning goal for each stage, and arrange the learning plan. After reaching the goal You can start the next stage of learning.
Ø Stage 1 Getting Started
This is the introductory stage when you have just come into contact with PHP. You must first understand the development capabilities of PHP and get in touch with some open source projects developed with PHP. There are many open source PHP projects on the Internet that can be downloaded. Learn first A simple function operation is enough, mainly to generate interest in learning PHP, and to understand PHP development needs and PHP development characteristics. Just like if you want to learn to build a car or repair a car, you must first learn to drive a car. Earlier in this chapter, we learned about the components required for web development, so it is definitely not possible to learn PHP in isolation, nor is it possible to learn PHP first. If you just started to contact web development and just learn PHP directly, you will not be able to do what you want, because PHP is a server-side script, so you need to install the PHP running environment to parse it. In addition, PHP is a scripting language embedded in HTML, so you need to understand some common HTML tags. It is very necessary to do some preparation before starting to learn PHP.
Ø Phase 2 Laying the foundation
This stage is the focus of learning, but the method is very important. You can learn as much detail as you can about the basic syntax and language structures of PHP (process control, functions, strings, etc.). Each knowledge point will be under development. Use it. For things like arrays, objects, file processing, image processing, mysql database operations, PHP database operations, etc., you need to learn some common parts first and know some basic applications. This can greatly improve the learning progress. Most newbies at this stage of learning will have two common problems: First, maybe they have almost forgotten what they learned last time when they learn new content that day. Of course, you don’t have to worry about this. Don’t stop. You must continue to learn, because the basic grammar is a technique that will be used in later knowledge. You will naturally remember it if you use it more. As for the advanced parts, you don’t have to worry about remembering them. They are all class libraries or function libraries. Just remember what functions the system has provided. You can check them through the manual when using them. It’s good to remember the commonly used ones. Second, the content in the book can be read and understood, but when I start to do it myself, I don’t know where to start and have no ideas. Therefore, after you understand the knowledge points at this stage, you must try your best to make a small project (for example, simulate writing a small mall, forum, or chat room, etc.). This project does not need to worry about security, optimization and code. Quality, as long as it can achieve the function. The purpose of this project is to open up your "two channels of Ren and Du", connect the scattered knowledge points of the basic parts together, and apply them in actual projects to better understand and master them.
Ø Phase Three Strengthening
After practicing the project development in Phase Two, I have accumulated some development ideas. I need to go back and learn each part of the knowledge points in depth, such as arrays, objects, regular expressions, database operations, and data structures. and algorithms, etc. These contents are the most commonly used technologies in PHP development. If you study at this stage, you can learn more comprehensively, thoroughly, and easier to master. Of course, you also need to learn some new content, such as template engines and PHP frameworks, and then start a project. The project at this stage cannot be like the project in stage 2, which only needs to implement basic functions. It requires not only good code quality, but also clear business logic. The structure of the project must also be based on the most fluent development model currently, using frameworks and template engines. , and adopt object-oriented thinking and the design requirements of the MVC pattern. We must also learn the project development process and specifications, and try our best to make this project meet the actual online project standards.
Ø Stage 4 Improvement
In this stage, it is recommended to learn at work, because there is no unified standard for the content of this stage, and solutions need to be designed based on actual projects. Of course, it is necessary to collect and learn more theories in this area, or to conduct some related experiments in simulated scenarios. In summary, the above four stages may seem simple, but they also require our full dedication and perseverance.
3. Insist on hands-on experiments
Have you ever played basketball? Shooting theory may be mastered quickly, but to improve your shooting percentage and become flexible and comfortable, you need repeated practice. The same goes for learning programming. Code that you can understand may not necessarily be written. If you can't write it, it's not yours! It is very necessary to practice more hands-on. Maybe when you first get into it, n errors will appear after writing a few lines of code. The errors that occur are the techniques that you have not mastered, and the problems that are solved are what you have learned. When errors occur, As you use less and less, your coding skills become more and more proficient. Of course, in order to solve code errors faster, you can write a few lines of code and run it in the early stage, which makes it easier to locate the bug location. In addition, writing code is the best way to practice theory. Technologies that you think are confusing can be explained through experiments. Also, when practicing, be sure to add comments to the code while practicing, or record study notes, summary and analysis.
As a programmer, I also had no ideas when I first learned programming. At least, I had to copy tens of thousands of lines of code before ideas gradually emerged. Just like when you first start writing an essay, you need to have an idea. Generally, you have to go through several stages. First, you learn vocabulary, then learn to form sentences, then read a lot of other people's articles, and then imitate and write some of your own. Only by gradually accumulating experience can you form your own. ideas. I'm afraid you have to take your time to learn programming. Just looking and listening, not doing it is not enough to learn programming well. Be more hands-on and start practicing by following the examples in the book or the accompanying teaching videos. Of course, it is best to add some of your own functions and type in some code according to your own ideas, and you will gain much more. Quantitative changes will lead to qualitative changes, and this kind of qualitative change has indeed happened many times. As a reminder, you must understand the idea of the code before typing along or typing behind your back. Do not place other people’s programs on the left and copy them one by one on the right. This will no longer be a programmer, but a typist. . What you get on paper will eventually make you feel shallow. Don’t ask so many questions, don’t think so much, just start writing.
4. The principle of putting first things first
When building a house, you must first build the skeleton and then talk about decoration. When painting landscapes, you must first paint the structure and then talk about polishing. To understand a machine with a complex structure, you should first understand the context clearly, and then gradually understand each joint. In order to cope with exams from primary school to university, we have memorized all kinds of details that should not be mastered in advance. At the same time, we have also developed the study habit of digging into details when we see them. Now when learning PHP, it’s time to change. "Grasp the big ones, let go the small ones, put first things first" is the attitude towards tedious affairs. For newcomers who have never come into contact with PHP before, PHP is undoubtedly huge. It seems that every field can be expanded and it is an open space. The energy spent on in-depth contact with every detail is undoubtedly huge. Most novices have great ambitions and stare at every new knowledge point with shining eyes. They want to dig out every knowledge point they encounter clearly and clearly. Is there anything wrong with this? My opinion is that there is nothing wrong with it, but the learning efficiency is too low! It is a character flaw to pursue perfection in anything before you dare to continue. Be brave enough to give up something. Only with losses can you gain. Use your limited and precious energy on areas directly related to important knowledge points. This is the most efficient way to learn! After you have grasped all the key points, and when you have time and energy to do nothing, then study the marginal technologies. Everything that is not closely related to our direct work goals can be thrown aside or clarified enough to support the next step of learning. Spending time and energy on developing projects, writing works, and practicing problem-solving skills is the right and quick way to become a master.
When you are reading somewhere and you don’t understand it for the time being, let it go for the time being and pursue some smooth and natural realm. Just don’t stop moving forward and don’t let the branches and trivial matters beside the road interfere with your progress. , projects, real projects, this is the purpose. Using projects to drive your own learning, and then supplementing detailed research after grasping the technical context, is the correct way to learn PHP.
Get LAMP Brothers’ original PHP tutorial CD/"Essential PHP in Detail" for free. For details, please contact the official customer service: http://www.lampbrother.net
|